Skip to content

[opengl.mod] Incorrect type for constants GL_FALSE and GL_TRUE #76

@MrMisanthrope

Description

@MrMisanthrope

Whilst building some example code which relies on sdl.mod/gl2sdlmax2d.mod I came across a problem with the definition of the GL_FALSE and GL_TRUE constants in opengl.mod.

As GL_TRUE and GL_FALSE are of GLboolean type, then they are essentialy 1 Byte sized which leads to compilation errors under BlitzMax NG as it declares them as default size type (Int) in the opengl.bmx file.

There are also inconsistencies in other places where True/False (BlitzMax type) is used instead of GL_TRUE/GL_FALSE and this also throws up the same error.

The error being: Argument #n is "Int" but declaration is "Byte"

Fix:
Change definition of lines 104 & 105 in pub.mod/opengl.mod/opengl.bmx

Const GL_TRUE=1
Const GL_FALSE=0

to...

Const GL_TRUE:Byte=1
Const GL_FALSE:Byte=0

Furthermore, any use of BlitzMax NG True/False under OpenGL use should be changed to GL_TRUE/GL_FALSE to prevent the same error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions