PDA

View Full Version : OpenGl - Multiple Windows



code_glitch
31-10-2010, 02:45 PM
I'm using an Sdl/OpenGl combination, sdl for image loading and opengl for processing and etc for better performanec without worrying about format wars. I found that a rather nice way to run the program could be to have multiple windows, so I made a Window object which has:



Window = Object
Screen: pSdl_Surface;
WindowWidth, WindowHeight: Int64;
ColourDepth: Int64;
end;


and a pointer in the main program has a ActiveWindow:^Window pointer so that when I draw images onto the screen I dont specify which window to draw on, it draws onto the window I last set as active. However, I know it should theoretically work since it works with one window, but any more than that and Sdl_Gl_SwapBuffers crashes.

The output is a blank glwindow with this in the console window:



An unhandled exception occurred at $00007FA45AE5D720 :
EAccessViolation : Access violation
$00007FA45AE5D720



with exit code 217...

Any ideas as to what could be causing this or a way to create multiple gl windows with sdl? Any help would be much appreciated.


cheers,
code_glitch.

PS: If this works in my game, I may add multi-window management to prometheus... Just a thought.

chronozphere
31-10-2010, 05:06 PM
I allways thought that this wasn't possible (or at least not officially supported). Is it your idea to try it this way?

Maybe you should ask this on the SDL forums. :)

code_glitch
31-10-2010, 05:09 PM
Ah, I was just wondering if anyone in the PGD community had succeeded. Anyway there's always plan b: Make a big window that fills the entire screen (fullscreen mode) and use 'virtual windows' or windows within the window... Thanks for that though. Anyway, time to code on.