Use all OpenGL extensions with one include file.

Headers, Bindings, Libraries for use with FreeBASIC, Please include example of use to help ensure they are tested and usable.
Post Reply
D.J.Peters
Posts: 8586
Joined: May 28, 2005 3:28
Contact:

Use all OpenGL extensions with one include file.

Post by D.J.Peters »

Over 400 OpenGL extension with more than 2,200 OpenGL comands as include file.

You can use all extensions from OpenGL

1.2/1.3/1.4/1.5
2.0/2.1
3.0/3.1/3.2/3.3
4.0/4.1/4.2/4.3/4.4

I can't post it here (more than 5,000 lines of code) right click save as "glextensions.bi"
download: glextensions.bi

All extensions are defined as shared GLboolean's.

if IS_GL_ARB_imaging=GL_TRUE then ...

if IS_GL_VERSION_2_0=GL_FALSE then
' no shader fixed render pipeline only
else
' use your funky shader stuff
endif

Joshy

Code: Select all

#include once "glextensions.bi"

#include "fbgfx.bi"
#if __FB_LANG__ = "fb"
using FB
#endif

screenres 640,480,32,,GFX_OPENGL
flip

if InitGLExtensions()=GL_FALSE then
  screen 0
  print "error: no active OpenGL context !"
endif

if IS_GL_VERSION_1_2 then
  ' ...
endif

if IS_GL_VERSION_1_3 then
  ' use multi textures (glActiveTexture ...)
endif

if IS_GL_VERSION_1_4 then
  ' ...
endif

if IS_GL_VERSION_1_5 then
  ' use all VBO stuff
else
  ' use glArray stuff instead
endif

if IS_GL_VERSION_2_0 then
  ' use GLSL stuff
else
  ' no shader fixed pipeline only
endif 

if IS_GL_VERSION_2_1 then
  ' ...
endif

if IS_GL_VERSION_3_0 then
  ' ...
endif

if IS_GL_VERSION_3_1 then
  ' ...
endif

if IS_GL_VERSION_3_2 then
  ' ...
endif

if IS_GL_VERSION_3_3 then
  ' ...
endif

if IS_GL_VERSION_4_0 then
  ' ...
endif

if IS_GL_VERSION_4_1 then
  ' ...
endif

if IS_GL_VERSION_4_2 then
  ' ...
endif

if IS_GL_VERSION_4_3 then
  ' ...
endif

if IS_GL_VERSION_4_4 then
  ' ...
endif
dim as single r,s=0.01
while inkey()=""
  glClearColor(r,0,0,1)
  glClear(GL_COLOR_BUFFER_BIT)
  r+=s
  if r<0 then
    r=0:s*=-1
  elseif r>1 then
    r=1:s*=-1
  endif  
  flip
  sleep 1
wend
Last edited by D.J.Peters on Oct 12, 2022 17:48, edited 4 times in total.
Haubitze
Posts: 44
Joined: May 20, 2016 8:42

Re: Use all OpenGL extensions with one include file.

Post by Haubitze »

nice peace of code, plz keep it up to date.
one suggestion, plz include an logger for aktivated extensions.

salute
D.J.Peters
Posts: 8586
Joined: May 28, 2005 3:28
Contact:

Re: Use all OpenGL extensions with one include file.

Post by D.J.Peters »

I uploaded a new version see first post.

All OpenGL Extensions are supported from OpenGL V1.0 - V4.4 (round about 400 extensions)
~2300 OpenGL commds are dynamic loaded bei the extension wrangler.

if IS_GL_VERSION_2_1 then
' ...
endif

if IS_GL_VERSION_3_2 then
' ...
endif

Joshy
Post Reply