As i was reading about openGL i came across Blending. here is the program.
Strict
Import BRL.System
Import PUB.Glew
Global ScreenWidth% = 640
Global ScreenHeight% = 480
Global ScreanDepth% = 32
bglCreateContext ScreenWidth , ScreenHeight , ScreanDepth , BGL_BACKBUFFER
Function InitGL()
glClearColor(1.0 , 1.0 , 0.0 , 0.0) 'Yellow BackGround
glClearDepth 1.0
glViewPort (0 , 0 , ScreenWidth , ScreenHeight)
glMatrixMode(GL_PROJECTION)
glLoadIdentity()
gluPerspective(60.0 , ScreenWidth / ScreenHeight , 1.0 , 20.0)
glMatrixMode(GL_MODELVIEW)
glLoadIdentity()
gluLookAt(0.0 , 0.0 , 5.0 , 0.0 , 0.0 , 0.0 , 0.0 , 1.0 , 0.0)
glBlendFunc GL_ONE , GL_ONE
glEnable GL_BLEND
End Function
InitGL()
While Not KeyDown(Key_Escape)
Display()
Keys()
FlushMem()
bglSwapBuffers()
Wend
Function Display()
glClear GL_COLOR_BUFFER_BIT
glColor3f 0.0 , 0.0 , 1.0
glRectf -0.5 , -0.5 , 0.5 , 0.5
End Function
Function keys()
If KeyHit(Key_A)
glBlendEquation GL_FUNC_ADD
EndIf
when i run the program and push the A Button BlitzMax Creates an error and crash the program
My quastion is : is this a bug of BlitzMax or rubish code of mine
Strict
Import BRL.System
Import PUB.Glew
Global ScreenWidth% = 640
Global ScreenHeight% = 480
Global ScreanDepth% = 32
bglCreateContext ScreenWidth , ScreenHeight , ScreanDepth , BGL_BACKBUFFER
Function InitGL()
glClearColor(1.0 , 1.0 , 0.0 , 0.0) 'Yellow BackGround
glClearDepth 1.0
glViewPort (0 , 0 , ScreenWidth , ScreenHeight)
glMatrixMode(GL_PROJECTION)
glLoadIdentity()
gluPerspective(60.0 , ScreenWidth / ScreenHeight , 1.0 , 20.0)
glMatrixMode(GL_MODELVIEW)
glLoadIdentity()
gluLookAt(0.0 , 0.0 , 5.0 , 0.0 , 0.0 , 0.0 , 0.0 , 1.0 , 0.0)
glBlendFunc GL_ONE , GL_ONE
glEnable GL_BLEND
End Function
InitGL()
While Not KeyDown(Key_Escape)
Display()
Keys()
FlushMem()
bglSwapBuffers()
Wend
Function Display()
glClear GL_COLOR_BUFFER_BIT
glColor3f 0.0 , 0.0 , 1.0
glRectf -0.5 , -0.5 , 0.5 , 0.5
End Function
Function keys()
If KeyHit(Key_A)
glBlendEquation GL_FUNC_ADD
EndIf
when i run the program and push the A Button BlitzMax Creates an error and crash the program
My quastion is : is this a bug of BlitzMax or rubish code of mine