Results 1 to 3 of 3

Thread: OpenGl - Multiple Windows

  1. #1
    PGD Staff code_glitch's Avatar
    Join Date
    Oct 2009
    Location
    UK (England, the bigger bit)
    Posts
    933
    Blog Entries
    45

    OpenGl - Multiple Windows

    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.
    I once tried to change the world. But they wouldn't give me the source code. Damned evil cunning.

  2. #2
    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.
    Coders rule nr 1: Face ur bugz.. dont cage them with code, kill'em with ur cursor.

  3. #3
    PGD Staff code_glitch's Avatar
    Join Date
    Oct 2009
    Location
    UK (England, the bigger bit)
    Posts
    933
    Blog Entries
    45
    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.
    I once tried to change the world. But they wouldn't give me the source code. Damned evil cunning.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •