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:

Code:
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:
Code:
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.