LWJGL Forum

Programming => Bug Reports / RFE => Topic started by: ra4king on August 06, 2014, 04:29:03

Title: Duplicate Enums
Post by: ra4king on August 06, 2014, 04:29:03
Hi,

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


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?
Title: Re: Duplicate Enums
Post by: spasi 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.
Title: Re: Duplicate Enums
Post by: Cornix 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.
Title: Re: Duplicate Enums
Post by: spasi on August 06, 2014, 16:12:20
Enums vs integers has been discussed on JGO recently, here (http://www.java-gaming.org/topics/opengl-why-are-lwjgl-enums-as-integers/33800/view.html).
Title: Re: Duplicate Enums
Post by: ra4king on August 07, 2014, 05:29:58
Let me paste all duplicates I've found in core versions:


So basically, GL40-43 have most of the duplicates.
Title: Re: Duplicate Enums
Post by: spasi 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.
Title: Re: Duplicate Enums
Post by: ra4king on August 07, 2014, 06:58:12
Thanks, using the latest nightly now, no duplicates found!