Skip to main content
gamedev.net
🔒 Locked

switching resolutions using bitmaps

Started by edwinnie 0 replies 300+ views
Original Post
edwinnie
edwinnie
i was able to load(finally) a 16bit hi-color bitmap. i was wondering if the switching of resolution from 1024x768x16 to 800x600x16 can be done this way> obviously, i got something wrong somewhere in the code. if u have done this b4, pls comment on the logicality of the code and see wat it lacks.
      
if (KEY_DOWN(VK_F1))
   {
   lpddsprimary->Unlock(primary_buffer);
	
   Unload_Bitmap_File(&bitmap16bit);
	
   if ((lpdd->SetDisplayMode(800,600,16))!=DD_OK)          
   return(0);
	
    // Create the primary surface

    memset(&ddsd,0,sizeof(ddsd));
    ddsd.dwSize         = sizeof(ddsd);
    ddsd.dwFlags        = DDSD_CAPS;                      
    ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE;         

    if (lpdd->CreateSurface(&ddsd,&lpddsprimary,NULL)!=DD_OK)
    return(0);

    
    Load_Bitmap_File(&bitmap16bit, "test1.bmp");
    } 
    
[edited by - edwinnie on April 11, 2002 7:43:47 AM]

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.