Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enums from extensions shold be in a const section. (Nim) #138

Open
krux02 opened this issue Mar 6, 2018 · 0 comments
Open

enums from extensions shold be in a const section. (Nim) #138

krux02 opened this issue Mar 6, 2018 · 0 comments

Comments

@krux02
Copy link

krux02 commented Mar 6, 2018

This is my generated var section.

# Extensions
var
  GLAD_GL_ARB_debug_output*: bool
  GL_DEBUG_OUTPUT_SYNCHRONOUS_ARB*: GLenum = GLenum(0x8242)
  GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH_ARB*: GLenum = GLenum(0x8243)
  GL_DEBUG_CALLBACK_FUNCTION_ARB*: GLenum = GLenum(0x8244)
  GL_DEBUG_CALLBACK_USER_PARAM_ARB*: GLenum = GLenum(0x8245)
  GL_DEBUG_SOURCE_API_ARB*: GLenum = GLenum(0x8246)
  GL_DEBUG_SOURCE_WINDOW_SYSTEM_ARB*: GLenum = GLenum(0x8247)
  GL_DEBUG_SOURCE_SHADER_COMPILER_ARB*: GLenum = GLenum(0x8248)
  GL_DEBUG_SOURCE_THIRD_PARTY_ARB*: GLenum = GLenum(0x8249)
  GL_DEBUG_SOURCE_APPLICATION_ARB*: GLenum = GLenum(0x824A)
  GL_DEBUG_SOURCE_OTHER_ARB*: GLenum = GLenum(0x824B)
  GL_DEBUG_TYPE_ERROR_ARB*: GLenum = GLenum(0x824C)
  GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR_ARB*: GLenum = GLenum(0x824D)
  GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR_ARB*: GLenum = GLenum(0x824E)
  GL_DEBUG_TYPE_PORTABILITY_ARB*: GLenum = GLenum(0x824F)
  GL_DEBUG_TYPE_PERFORMANCE_ARB*: GLenum = GLenum(0x8250)
  GL_DEBUG_TYPE_OTHER_ARB*: GLenum = GLenum(0x8251)
  GL_MAX_DEBUG_MESSAGE_LENGTH_ARB*: GLenum = GLenum(0x9143)
  GL_MAX_DEBUG_LOGGED_MESSAGES_ARB*: GLenum = GLenum(0x9144)
  GL_DEBUG_LOGGED_MESSAGES_ARB*: GLenum = GLenum(0x9145)
  GL_DEBUG_SEVERITY_HIGH_ARB*: GLenum = GLenum(0x9146)
  GL_DEBUG_SEVERITY_MEDIUM_ARB*: GLenum = GLenum(0x9147)
  GL_DEBUG_SEVERITY_LOW_ARB*: GLenum = GLenum(0x9148)

  GLAD_GL_ARB_direct_state_access*: bool
  GL_TEXTURE_TARGET*: GLenum = GLenum(0x1006)
  GL_QUERY_TARGET*: GLenum = GLenum(0x82EA)
  GL_TEXTURE_BINDING_CUBE_MAP_ARRAY*: GLenum = GLenum(0x900A)

But for example when I want to use GL_DEBUG_TYPE_ERROR_ARB is a switch case, that value needs to be const. Therefore the generated source should look like this:

# Extensions
const
  # GL_ARB_debug_output
  GL_DEBUG_OUTPUT_SYNCHRONOUS_ARB*: GLenum = GLenum(0x8242)
  GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH_ARB*: GLenum = GLenum(0x8243)
  GL_DEBUG_CALLBACK_FUNCTION_ARB*: GLenum = GLenum(0x8244)
  GL_DEBUG_CALLBACK_USER_PARAM_ARB*: GLenum = GLenum(0x8245)
  GL_DEBUG_SOURCE_API_ARB*: GLenum = GLenum(0x8246)
  GL_DEBUG_SOURCE_WINDOW_SYSTEM_ARB*: GLenum = GLenum(0x8247)
  GL_DEBUG_SOURCE_SHADER_COMPILER_ARB*: GLenum = GLenum(0x8248)
  GL_DEBUG_SOURCE_THIRD_PARTY_ARB*: GLenum = GLenum(0x8249)
  GL_DEBUG_SOURCE_APPLICATION_ARB*: GLenum = GLenum(0x824A)
  GL_DEBUG_SOURCE_OTHER_ARB*: GLenum = GLenum(0x824B)
  GL_DEBUG_TYPE_ERROR_ARB*: GLenum = GLenum(0x824C)
  GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR_ARB*: GLenum = GLenum(0x824D)
  GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR_ARB*: GLenum = GLenum(0x824E)
  GL_DEBUG_TYPE_PORTABILITY_ARB*: GLenum = GLenum(0x824F)
  GL_DEBUG_TYPE_PERFORMANCE_ARB*: GLenum = GLenum(0x8250)
  GL_DEBUG_TYPE_OTHER_ARB*: GLenum = GLenum(0x8251)
  GL_MAX_DEBUG_MESSAGE_LENGTH_ARB*: GLenum = GLenum(0x9143)
  GL_MAX_DEBUG_LOGGED_MESSAGES_ARB*: GLenum = GLenum(0x9144)
  GL_DEBUG_LOGGED_MESSAGES_ARB*: GLenum = GLenum(0x9145)
  GL_DEBUG_SEVERITY_HIGH_ARB*: GLenum = GLenum(0x9146)
  GL_DEBUG_SEVERITY_MEDIUM_ARB*: GLenum = GLenum(0x9147)
  GL_DEBUG_SEVERITY_LOW_ARB*: GLenum = GLenum(0x9148)
  # GL_ARB_direct_state_access
  GL_TEXTURE_TARGET*: GLenum = GLenum(0x1006)
  GL_QUERY_TARGET*: GLenum = GLenum(0x82EA)
  GL_TEXTURE_BINDING_CUBE_MAP_ARRAY*: GLenum = GLenum(0x900A)

var
  GLAD_GL_ARB_debug_output*: bool
  GLAD_GL_ARB_direct_state_access*: bool
  glDebugMessageControlARB*: proc (source: GLenum, `type`: GLenum, severity: GLenum, count: GLsizei, ids: ptr GLuint, enabled: GLboolean) {.cdecl.}
  glDebugMessageInsertARB*: proc (source: GLenum, `type`: GLenum, id: GLuint, severity: GLenum, length: GLsizei, buf: cstring) {.cdecl.}
  glDebugMessageCallbackARB*: proc (callback: GLDEBUGPROCARB, userParam: pointer) {.cdecl.}
  glGetDebugMessageLogARB*: proc (count: GLuint, bufSize: GLsizei, sources: ptr GLenum, types: ptr GLenum, ids: ptr GLuint, severities: ptr GLenum, lengths: ptr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants