Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Screenres just freezes...
#1
I'm trying to open an OpenGL window, though, when I use Screenres with 2 as parameter (which means, an opengl window), it just crashes...does this crash for you aswell?

Code:
Declare Function InitOpenGL (scrWidth As Integer, scrHeight As Integer)

'$include: "\gl\gl.bi"                
'$include: "\gl\glu.bi"  

ScreenRes 640, 480, 32, 1, 2

InitOpenGL(640, 480)

Do
Loop Until Multikey(1)

Function InitOpenGL (scrWidth As Integer, scrHeight As Integer)
    glViewPort 0, 0, scrWidth, scrHeight
    
    glMatrixMode GL_PROJECTION
    glLoadIdentity
    
    gluPerspective 45, scrWidth / scrHeight, 1.0, 100
    
    glMatrixMode GL_MODELVIEW
    glLoadIdentity
    
    glShadeModel GL_SMOOTH
    
    glClearColor 0.0, 0.0, 0.0, 0.0
    glClearDepth 1.0
    
    glEnable GL_DEPTH_TEST
End Function
It's the difference between asking someone how much flour goes into pancakes, and handing them a sorry mix of oozing green goo and asking them to fix it." - Deleter

-Founder & President of the No More Religion Threads movement-
Reply
#2
You need to have it do something.
Try adding a Flip statement within the loop. That should help.

Edit: See this page for the reason- http://www.freebasic.net/wiki/wikka.php?wakka=KeyPgFlip
974277320612072617420666C61696C21 (Hexadecimal for those who don't know)
Reply
#3
Thanks! 8)
It's the difference between asking someone how much flour goes into pancakes, and handing them a sorry mix of oozing green goo and asking them to fix it." - Deleter

-Founder & President of the No More Religion Threads movement-
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)