Login or Signup

Simple OpenGL operation not working?

BlitzMax Forums/OpenGL Module/Simple OpenGL operation not working?

Kryzon1+ years ago #1
can someone tell me why the following doesn't work?

Graphics 800,600

myImage:TImage = LoadImage("image.png")

While Not KeyHit(KEY_ESCAPE) Or AppTerminate()

	DrawImage myImage,0,0


The screen is supposed to be completely black because of the glClear, but the image is still showing. It's like glClear is doing nothing.

Not only for this glClear, but I can't set any other state like glBlendFunc etc.
When I call Max2D's SetBlend() method it works properly, even though the same calls are going under the hood.
If I copy and paste SetBlend's code into an external function and call that, no changes are made - it's like I can't call OpenGL raw functions with my own code, even though I use modules that call these functions and don't suffer from the same problems (like Max2D or MiniB3D).

Regular K1+ years ago #2
Defaults to DirectX9 graphics driver.

SetGraphicsDriver GLMax2DDriver()

to the top will fix that.

You can use:
print GetGraphicsDriver().tostring()

to find out the current drivers name.

Kryzon1+ years ago #3
I'm sure I'll never forget this one.
Thanks for the answer!

Last edited 1+ years ago

Blitz Social Club