Quick opengl question.

Previous topic - Next topic

fuzzy70

Hi All,

I have just downloaded GLBasic the other day having come from a background of Blitz3D, Purebasic & minimal amount of VisualBasic.

Getting used to the syntax & differences is slowly getting there but time will sort that out :)

While learning GLBasic I am currently reading the OpenGL Bible & playing around with /common/gl.bas include. The speed difference is quite noticeable using OpenGL compared to the in-built commands I have tested so far, only pixels & lines at the moment. For example to fill the screen (an 800x600) using SETPIXEL takes around  259ms on my system, using glVertex2f to plot the same pixels takes 11ms on average. Lines as well show a big speed increase also but this is not the reason of my question lol.

Is there anyway of adding the glGetString() command/function to the gl.bas code?. The GLOBALS for GL_VENDOR, GL_RENDERER, GL_VERSION & GL_EXTENSIONS etc are all defined but I am unable to get the results from them due to lacking glGetString(). I noticed the functions in gl.bas are inline & contain C code (could be C++ as far as I know as never got passed helloword.c  :-[ ).

While it is not extremely urgent or in some respects required, but might come in handy for checking capabilities etc of the machine on which the code is running, the book mentions using GL_EXTENSIONS to check if a feature is supported & hence the reason for this question.

Regards

"Why don't you just make ten louder and make ten be the top number and make that a little louder?"
- "These go to eleven."

This Is Spinal Tap (1984)

Kitty Hello

SETPIXEL is a bad thing for speed. If you want fast pixels, write them in an array and use MEM2SPRITE.

there's a PLATFORMINFO$ command that can check for a function to exist. Or an extension, test it.

fuzzy70

Quote from: Kitty Hello on 2011-Oct-24
there's a PLATFORMINFO$ command that can check for a function to exist. Or an extension, test it.

Aha, thank you. That would explain the lack of a glGetString() function  =D
"Why don't you just make ten louder and make ten be the top number and make that a little louder?"
- "These go to eleven."

This Is Spinal Tap (1984)