SetGFXDriver OpenGL errors?

Archives Forums/BlitzPlus Bug Reports/SetGFXDriver OpenGL errors?

norki(Posted 2005) [#1]
SetGFXDriver OpenGL errors?
---------------------------

If SetGfxDriver is set to OpenGL, when the program ends, a memory access violation occurs:
AppName: blitzcc.exe AppVer: 0.0.0.0 ModName: runtime_dbg.dll
ModVer: 0.0.0.0 Offset: 00028e86

The game I'm writing is windowed using CreateWindow(), and I noticed, if debug is enabled,
upon program end, this pops up: "***** INTERNAL ERROR ***** Attempt to release <unknown> object"

I've tested this on two computers; a WinXP Pro/SP2 Intel Celeron 1500mhz 240mb ram laptop with an Intel(R) Extreme Graphics 2 for Mobile gfx card, and a Pentium1 100mhz 112mb ram Win98SE desktop, gfx card unknown. DirectX 9.0c

Please run these examples with debug enabled.

Here's a simple test
SetGfxDriver 2 ;Set to OpenGL

Graphics 320,240,0,2

While Not KeyHit(1)
	Cls
	Oval 80,80,80,80
	Flip
Wend
End

Using Windows GUI
SetGfxDriver 2 ;Set to OpenGL

winw=320
winh=240
window=CreateWindow("test",ClientWidth(Desktop())/2-winw/2,ClientHeight(Desktop())/2-winh/2,winw,winh,Desktop(),3+32)
canvas=CreateCanvas(0,0,winw,winh,window)

SetBuffer CanvasBuffer(canvas)

Repeat
Cls
	Oval 80,80,80,80
	FlipCanvas(canvas)
Until WaitEvent()=$803
End


Another thing, if SetGfxDriver is set to Native, SetGadgetLayout canvas,1,1,1,1 is rendered useless,
so stretching/scaling a canvas using SetGadgetShape is impossible.

Appreciate if you correct this, or me :)


CS_TBL(Posted 2005) [#2]
Without looking at the source, but this "***** INTERNAL ERROR ***** Attempt to release <unknown> object" reminds me of only one thing: Before you end the program with 'End' add this: "Setbuffer Desktopbuffer()"

a minor nittpick about your loop:

Repeat
Until WaitEvent()=$803
End

is better to be done as:

Repeat
WaitEvent()
If EventID()=$803 quit=true
Until quit
; clean-up here
End

The handy part is that you can quit the program from anywhere then by making 'quit' a global. You could ofcourse also type 'End' anywhere but that doesn't give you the opportunity to clean things up first.


norki(Posted 2005) [#3]
Setbuffer Desktopbuffer() didn't fix it. Instead of "***** INTERNAL ERROR ***** Attempt to release <unknown> object",
there's now a memory access violation :\

Thanks for the loop tip :)