Jump to content


opengl causing c# application to close


3 replies to this topic

#1 supagu

    New Member

  • Members
  • PipPip
  • 14 posts

Posted 15 September 2005 - 12:29 PM

i have a c++ dll in which i call
SDL_SetVideoMode with the flag:
SDL_OPENGL to init opengl for me.

Now i'm using this c++ dll in a c# project i create my opengl window/device then at the end of the c# method it closes the c# application (calls Dispose method, where normally it would call my paint method)

any ideas? maybe sdl is setting opengl up incorrectly for window mode for me or somehting?

#2 anubis

    Senior Member

  • Members
  • PipPipPipPip
  • 2225 posts

Posted 15 September 2005 - 01:13 PM

Well, are you entering any message loop after you open the window ?
If Prolog is the answer, what is the question ?

#3 supagu

    New Member

  • Members
  • PipPip
  • 14 posts

Posted 17 September 2005 - 06:36 AM

okay i debugged the sdl dll, and seems the problem is that they are making a temporary window init some OGL stuff then destroy the window. When this temporary window is destroyed it doing something bad in c# and then my c# application ends up calling dispose.

is there maybe a way i can hack things to dispose doesnt get called. ie. maybe unregister it with garbage collector while it sets up my engine window?

#4 skitz_nz

    New Member

  • Members
  • Pip
  • 2 posts

Posted 23 September 2005 - 11:41 PM

Not sure whether you've managed to solve your problem or not, but thought I'd mention this OpenGL wrapper for C#, which I've used for several projects. Its quite handy, doesn't require any additional DLLs or files, just a few .cs files to add to your project.

http://www.colinfahe...engl/csharp.htm

Of course, it is no use if you want to use SDL for more than just graphics, but its a good resource nonetheless.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users