Oxygen Basic

Programming => Example Code => Topic started by: Peter on June 23, 2012, 08:22:58 AM

Title: Glut Demos
Post by: Peter on June 23, 2012, 08:22:58 AM
Deleted
Title: Re: Glut Demos
Post by: Charles Pegge on June 23, 2012, 01:23:35 PM

Hi Peter,

Problem here running your Glut Demos. I will try to find out why. (GPF)

I am going to adopt Glut as part of the Oxygen package, (as well as the Opengl headers), so they will always be available if you want to use them with your demos.

I found freeGlut pretty easy to use and it's cross-platform so the code is easy to share code with the wider programming community.

Charles
Title: Re: Glut Demos
Post by: Charles Pegge on June 23, 2012, 02:39:00 PM

Peter, just looking at your code: the callbacks need to be cdecl. Important when params are passed.

function f cdecl (...) callback
Title: Re: Glut Demos
Post by: Charles Pegge on June 24, 2012, 09:23:25 AM

To get my GLUT demos to work, I created an extern cdecl block for the callbacks. Otherwise crashes within 1 second! It shows up very rapidly with mouse moves.

extern cdecl

...

end extern

Charles
Title: Re: Glut Demos
Post by: Charles Pegge on June 24, 2012, 10:33:59 AM
Best to get to get the whole header and clean it up, as I have done with the FreeGlut header.

All pointers and handles  should be declared sys, long or dword for 32 bits, short or word for 16 bits.

once the base types have been typedef'd, very little needs to be changed in the header

example:

typedef dword uint32
typedef word   uint16
typedef byte    uint8
...