PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : SDL Problemchen


Einfachkrank
2004-10-19, 07:30:42
Hi,

das erste Problem: mir gelingt es nicht bei einer mit SDL initialisierten Anwendung ich mein Icon nicht laden kann. Hab es mit SDL_WM_SetCaption() versucht...

das zweite betrifft die vertikale Syncronisation. Wird die unter SDL in Verbindung mit OpenGL automatisch eingeschaltet? Kann ich die abschalten und wenn macht das Sinn?

MFG Einfachkrank

peecee
2004-10-19, 18:03:12
Synopsis:
void SDL_WM_SetIcon(SDL_Surface *icon, Uint8 *mask);

Example:
SDL_WM_SetIcon(SDL_LoadBMP("icon.bmp"), NULL);

das müsste dein erstes Problem lösen.

mfg

RLZ
2004-10-19, 18:25:37
Zum 2. Prob:
Wenn du im ControlPanel irgendwas forced dann kann das Spiel auch nichts machen.
Ansonsten kannst in OpenGL mit der WGL_EXT_swap_control - Extension VSync ausschalten.

Hier seh ich ja mal sogar nen Sinn einer WGL-Extension, aber beim pbuffer... *grummel*

Einfachkrank
2004-10-20, 08:05:25
Sollte das BMP für das Icon bestimmte Anforderungen haben? Denn SDL_WM_SetIcon() hab ich auch schon versucht, aber es erscheint kein Icon...

peecee
2004-10-20, 17:10:57
Hast du den keine SDL Doku?

Description:

Sets the icon for the display window. Win32 icons must be 32x32.

This function must be called before the first call to SDL_SetVideoMode.

The mask is a bitmask that describes the shape of the icon. If mask is NULL, then the shape is determined by the colorkey of icon, if any, or makes the icon rectangular (no transparency) otherwise.

If mask is non-NULL, it points to a bitmap with bits set where the corresponding pixel should be visible. The format of the bitmap is as follows: Scanlines come in the usual top-down order. Each scanline consists of (width / 8) bytes, rounded up. The most significant bit of each byte represents the leftmost pixel.