Hello Guest

Duplicate Enums

  • 6 Replies
  • 7854 Views
*

Offline ra4king

  • **
  • 58
  • I'm the King!
    • Roi's Website
Duplicate Enums
« on: August 06, 2014, 04:29:03 »
Hi,

I found some more duplicate enums, with default class name in bold:

  • GL_TEXTURE_1D: GL11, GL43
  • GL_TEXTURE_2D: GL11, GL43
  • GL_TEXTURE_3D: GL12, GL43
  • GL_TEXTURE_2D_ARRAY: GL30, GL43
  • GL_QUADS: GL11, ARBTessellationShader

I wrote a tool that automatically finds duplicates, so I have a million more duplicates! Is it best to send a pull request with the removed duplicates in LWJGL 2/3?
« Last Edit: August 06, 2014, 04:31:46 by ra4king »
-Roi

*

Offline spasi

  • *****
  • 2258
    • WebHotelier
Re: Duplicate Enums
« Reply #1 on: August 06, 2014, 09:39:22 »
Thanks, they have been removed. I also have a tool that detects duplicates, just hadn't run it on LWJGL 3 before.

It's normal that you've found so many duplicates, but most of the duplicate constants in extensions cannot be removed. It's only OK to remove those that have been defined in a core version less than or equal to the minimum version an extension requires (e.g. ARB_shader_subroutine requires GL 3.2 so UNIFORM_SIZE and UNIFORM_NAME_LENGTH, defined in GL 3.1, could safely be removed). I did this manually in LWJGL 2 (might have missed some, let me know if you find any), but I plan to "annotate" extensions in LWJGL 3 with the minimum core spec required, so that future cleanup can be done automatically.

*

Offline Cornix

  • *****
  • 488
Re: Duplicate Enums
« Reply #2 on: August 06, 2014, 14:05:29 »
Why do you not use Java enums instead of integer values?
This would be much easier to manage in my opinion.

*

Offline spasi

  • *****
  • 2258
    • WebHotelier
Re: Duplicate Enums
« Reply #3 on: August 06, 2014, 16:12:20 »
Enums vs integers has been discussed on JGO recently, here.

*

Offline ra4king

  • **
  • 58
  • I'm the King!
    • Roi's Website
Re: Duplicate Enums
« Reply #4 on: August 07, 2014, 05:29:58 »
Let me paste all duplicates I've found in core versions:

  • GL_UNIFORM_SIZE: GL31, GL40
  • GL_TEXTURE_RECTANGLE: GL31, GL43
  • GL_UNIFORM_NAME_LENGTH: GL31, GL40
  • GL_STACK_OVERFLOW: GL11, GL43
  • GL_TEXTURE_CUBE_MAP: GL13, GL43
  • GL_TEXTURE_1D_ARRAY: GL30, GL43
  • GL_IMAGE_FORMAT_COMPATIBILITY_TYPE: GL42, GL43
  • GL_TEXTURE_BUFFER: GL31, GL43
  • GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER: GL30, GL32
  • GL_DOUBLE_MAT4x2: GL40, GL41
  • GL_DOUBLE_MAT4x3: GL40, GL41
  • GL_SCISSOR_BOX: GL11, GL41
  • GL_NUM_SAMPLE_COUNTS: GL42, GL43
  • GL_DOUBLE_MAT3x4: GL40, GL41
  • GL_DOUBLE_MAT3x2: GL40, GL41
  • GL_DEPTH_RANGE: GL11, GL41
  • GL_SAMPLES: GL13, GL43
  • GL_VIEWPORT: GL11, GL41
  • GL_SCISSOR_TEST: GL11, GL41
  • GL_DOUBLE_MAT2x4: GL40, GL41
  • GL_DOUBLE_MAT2x3: GL40, GL41
  • GL_DOUBLE_VEC4: GL40, GL41
  • GL_DOUBLE_VEC3: GL40, GL41
  • GL_DOUBLE_VEC2: GL40, GL41
  • GL_TEXTURE_2D_MULTISAMPLE_ARRAY: GL32, GL43
  • GL_STACK_UNDERFLOW: GL11, GL43
  • GL_LAST_VERTEX_CONVENTION: GL32, GL41
  • GL_DOUBLE_MAT4: GL40, GL41
  • GL_DOUBLE_MAT3: GL40, GL41
  • GL_DOUBLE_MAT2: GL40, GL41
  • GL_TEXTURE_COMPRESSED: GL13, GL43
  • GL_TEXTURE_2D_MULTISAMPLE: GL32, GL43
  • GL_FIRST_VERTEX_CONVENTION: GL32, GL41
  • GL_MAX_VARYING_COMPONENTS: GL30, GL32
  • GL_TEXTURE_CUBE_MAP_ARRAY: GL40, GL43
  • GL_RENDERBUFFER: GL30, GL43
  • GL_SRC1_ALPHA: GL15, GL33
  • GL_PROVOKING_VERTEX: GL32, GL41

So basically, GL40-43 have most of the duplicates.
« Last Edit: August 07, 2014, 05:34:26 by ra4king »
-Roi

*

Offline spasi

  • *****
  • 2258
    • WebHotelier
Re: Duplicate Enums
« Reply #5 on: August 07, 2014, 06:16:23 »
You're probably using 2.9.1, some of these were removed months ago and there's none in the latest nightly.

*

Offline ra4king

  • **
  • 58
  • I'm the King!
    • Roi's Website
Re: Duplicate Enums
« Reply #6 on: August 07, 2014, 06:58:12 »
Thanks, using the latest nightly now, no duplicates found!
-Roi