Why? GLBasic uses the default OpenGL 1.1 headers for it's OpenGL. These are functional but lack a lot of features. Advanced blending modes, shaders with decent features etc. need GL 3.0+
To add OpenGL functionality to your project I use GLee (GL Easy Extension library), see here...
https://www.opengl.org/sdk/libs/GLee/To use it within your projects all the hard work is done within the project options dialog. I used the GCC command line option to pre-empt the GLBasic linking process.
Before that though, I need a folder, within my games ("PMS") project folder to hold the GLee.h and GLee.c library files. See attached archive.
STEP 1: Create a container folder and copy the GLee files into itFor my PMS game, its in "MyC", within the PMS game project folder...
"C:\Coding Folder\Projects\GLBasic\PMS\MyC"
Obviously change the "C:\Coding Folder\Projects\GLBasic\PMS\" bit to match your own projects path.
Once that has been created. Extract the files mentioned above into the "MyC" folder.
STEP 2: Include the header and link it's library file in the project optionsOpen your project options dialog ( In the GLB IDE Menu - "Project" then "Options" )
An on your "cmp" (Compiler command line options) and "lnk" (Linker command line options) add these two lines (keep the quotes BTW)
In "cmp" ...
-I"C:\Coding Folder\Projects\GLBasic\PMS\MyC" -include GLee.h
In "lnk" ...
"C:\Coding Folder\Projects\GLBasic\PMS\MyC\GLee.c"
Save and exit.
Thats it!
Here's a very quick test for OpenGL 3.0 support ...
INLINE
if (GLEE_VERSION_3_0)
{
//OpenGL 3.0 is supported (Minimum)
DEBUG( (DGStr)" OpenGL 3.0+ supported " );
}
glClampColor(GL_CLAMP_READ_COLOR, GL_FALSE); // Quick usless OpenGL 3.0 only command
// to show that its working. Remove in final game!
// There should be NO compile errors if GLBasic accepts
// it as a valid inline command.
ENDINLINE
Check for errors. The above should be at the beginning of any program that uses this lib as it's a good check for older unsupported cards too.
A couple of tips.
Changing the linked library("lnk") "C:\Coding Folder\Projects\GLBasic\PMS\MyC\GLee.c" to ""C:\Coding Folder\Projects\GLBasic\PMS\MyC\GLee.a" allows for static linking of GLee and therefore much quicker compiles. But you will need to recompile (GLee.c & GLee.h into GLee.a) for any other platform other than Windows to staticly link it for another platform. There is a Windows "GLee.a" in the "GLee_MinGW.zip" within the main archive. This is what I actually use.
Once the library is installed, you now have full OpenGL inline support using DGInt, DGNat, DGStr etc. This is VERY handy once you get comfortable with mixing inline GL code with normal GLBasic. It's also very easy to wrap the new GL commands.