The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.


SDL Forum Index
SDL
Simple Directmedia Layer Forums
Multisampling and Resize problem
Göttling Thomas
Guest

Hi


Recently we upgrade to the newest SDL 1.2.11
Now we expect 2 Problems with the OpenGL context. May this a Problem in SDL?

Multisampling doesn?t work

This is our Initialisation of the Window:

SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1);
SDL_GL_SetAttribute( SDL_GL_STENCIL_SIZE, Cool;
SDL_GL_SetAttribute( SDL_GL_SWAP_CONTROL , 0 );
SDL_GL_SetAttribute( SDL_GL_ACCELERATED_VISUAL, 1 );

if(antialisingwert > 0) {
if( SDL_GL_SetAttribute(SDL_GL_MULTISAMPLEBUFFERS, 1 ) != 0)
popup("Error Multisampel Buffer");
if( SDL_GL_SetAttribute(SDL_GL_MULTISAMPLESAMPLES,
antialisingwert) != 0)

popup("Error Multisamples");
int buffers, samples;
SDL_GL_GetAttribute( SDL_GL_MULTISAMPLEBUFFERS, &buffers );
SDL_GL_GetAttribute( SDL_GL_MULTISAMPLESAMPLES, &samples );
DEBUG("Buffers: %d Samples: %d", buffers, samples);

}

/////// SOME CODE ////////

screen = SDL_SetVideoMode(width, high, bpp,
SDL_DOUBLEBUF|SDL_OPENGL|SDL_HWSURFACE|SDL_RESIZABLE);

//////// SOME CODE //////////


int Buffers, Samples;
SDL_GL_GetAttribute( SDL_GL_MULTISAMPLEBUFFERS, &Buffers );
SDL_GL_GetAttribute( SDL_GL_MULTISAMPLESAMPLES, &Samples );
if( antialisingwert > 0 && ( !Buffers || !Samples ) ) {
popup("Multisampling failure");
} else {
// FSAA was enabled.
}

Antialisingwert is set to 4 in this Example.
The Return value by the Deub out is: Buffers: 0 Samples: 1

Why Antialising ist?n working? Im?m Using a GForce 6600


Second Problem ? Resize the GL window
Risizing do Work. I Also resize the GL Matrix, and everything else.

Problem:
- I Start with a Window 1024x786
- Now I Resize the Window biger in both directions

SDL_PollEvent
Dont generate Events, if i move the Mouse higher than 1024
in the old Rect
of 1024x768 its working fine, but in the ?new Areas? there is no
Mouse-Motion event

Best Regards, and thanks for your Time!


Thomas G?ttling
Multisampling and Resize problem
Göttling Thomas
Guest

Found the Problem!

If SDL_GL_ACCELERATED_VISUAL is set to 1, Multisampling dosnt Work.... I
have no idea why...


mit freundlichem Gru? aus Friedberg

Thomas G?ttling
Multisampling and Resize problem
Mikael Eriksson
Guest

On Sun, Jul 02, 2006 at 10:04:23AM +0200, G?ttling Thomas wrote:
Quote:
Hi
Second Problem ? Resize the GL window
Risizing do Work. I Also resize the GL Matrix, and everything else.

Problem:
- I Start with a Window 1024x786
- Now I Resize the Window biger in both directions

SDL_PollEvent
Dont generate Events, if i move the Mouse higher than 1024
in the old Rect
Quote:
of 1024x768 its working fine, but in the ?new Areas? there is no
Mouse-Motion event

You need to call SDL_SetVideoMode with the new size, otherwise it will
behave strange.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: Digital signature
Url : http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20060702/ecb5d981/attachment.pgp
Multisampling and Resize problem
Göttling Thomas
Guest

Good Evening,

Tnx fort he Tipp, but it still dosn?t work.
Is there Anywhere a Example with SDL-OpenGL and getting the Mouse-position
as an Event after resizing?

I nearly think it?s a bug within SDL. I tried all associated Commands like
disabling and enabling mouse capture, re-setting the screen-rect.

Do you have any idea of another try to get the Moseevents in den "new Areas"
after resizing the Window?


Best Regards

Thomas G?ttling



-----Urspr?ngliche Nachricht-----
Von: sdl-bounces+raven=tcp2.de at libsdl.org
[mailto:sdl-bounces+raven=tcp2.de at libsdl.org] Im Auftrag von Mikael Eriksson
Gesendet: Sonntag, 2. Juli 2006 22:13
An: A list for developers using the SDL library. (includes SDL-announce)
Betreff: Re: [SDL] Multisampling and Resize problem

On Sun, Jul 02, 2006 at 10:04:23AM +0200, G?ttling Thomas wrote:
Quote:
Hi
Second Problem ? Resize the GL window
Risizing do Work. I Also resize the GL Matrix, and everything else.

Problem:
- I Start with a Window 1024x786
- Now I Resize the Window biger in both directions

SDL_PollEvent
Dont generate Events, if i move the Mouse higher than 1024
in the old
Rect
Quote:
of 1024x768 its working fine, but in the ?new Areas? there is no
Mouse-Motion event

You need to call SDL_SetVideoMode with the new size, otherwise it will
behave strange.