Jump to content

  • Log In with Google      Sign In   
  • Create Account

Interested in a FREE copy of HTML5 game maker Construct 2?

We'll be giving away three Personal Edition licences in next Tuesday's GDNet Direct email newsletter!

Sign up from the right-hand sidebar on our homepage and read Tuesday's newsletter for details!


We're also offering banner ads on our site from just $5! 1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


problems in changing the Palette in DDSCL_NORMAL mode


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
1 reply to this topic

#1 Luca   Members   -  Reputation: 122

Like
Likes
Like

Posted 24 August 2001 - 03:04 AM

Hello from a beginner in directdraw programming I''m writing a program that changes the palette of an image in windowed mode but it doesn''t want to work!! How can I modify my code to perform a SetPalette operation on the primary surface in order to chenge the pixel color on the screen? Thanks for the help Luca LPDIRECTDRAW lpDD; LPDIRECTDRAWSURFACE lpDDSPrimary; // DirectDraw primary surface LPDIRECTDRAWSURFACE lpDDSOne; // Offscreen surface 1 LPDIRECTDRAWCLIPPER lpClipper; // clipper for primary LPDIRECTDRAWPALETTE lpDDPal; // DirectDraw palette HRESULT ddrval; ddrval = DirectDrawCreate( NULL, &lpDD, NULL ); ddrval = lpDD->SetCooperativeLevel( m_hWnd, DDSCL_NORMAL ); // Create the primary surface DDSURFACEDESC ddsd; ZeroMemory(&ddsd,sizeof(ddsd)); ddsd.dwSize = sizeof( ddsd ); ddsd.dwFlags = DDSD_CAPS; ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE; ddrval = lpDD->CreateSurface( &ddsd, &lpDDSPrimary, NULL ); // create a clipper for the primary surface ddrval = lpDD->CreateClipper( 0, &lpClipper, NULL ); ddrval = lpClipper->SetHWnd( 0, m_hWnd ); ddrval = lpDDSPrimary->SetClipper( lpClipper ); lpDDPal = DDLoadPalette(lpDD, m_BitmapPath.c_str()); lpDDSOne = DDLoadBitmap(lpDD, m_BitmapPath.c_str(), 0, 0); //** modifying the palette entries... ///.... ddrval = lpDDSPrimary->SetPalette(lpDDPal); // !!! Error ????

Sponsor:

#2 evaclear   Members   -  Reputation: 162

Like
Likes
Like

Posted 24 August 2001 - 03:11 AM

The problem with windowed mode is that you don''t get to select the screen''s resolution and depth on game startup. This is all determined by what ever your current desktop setting happens to be. So trying to rotate a palette while your desktop is in 16,24, or 32bit color isn''t going to work...Make sure your in 8bit mode, that should solve your problem.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS