View previous topic :: View next topic |
Author |
Message |
h3r3tic
Joined: 30 Mar 2004 Posts: 261 Location: Torun, Poland
|
Posted: Fri Sep 23, 2005 6:57 am Post subject: Bug in DerelictGL |
|
|
Hi there. A few functions in DerelictGL are loaded incorrectly. Caused a few nice crashes and a whole lot of confusion
Code: |
glCopyTexImage1D = cast(pfglCopyTexImage1D)getProc("glTexImage1D");
glCopyTexImage2D = cast(pfglCopyTexImage2D)getProc("glTexImage2D");
glCopyTexSubImage1D = cast(pfglCopyTexSubImage1D)getProc("glTexSubImage1D");
glCopyTexSubImage2D = cast(pfglCopyTexSubImage2D)getProc("glTexSubImage2D");
|
|
|
Back to top |
|
|
JJR
Joined: 22 Feb 2004 Posts: 1104
|
Posted: Fri Sep 23, 2005 8:39 pm Post subject: |
|
|
Loaded incorrectly? What do you mean? Are the function declarations / argument types incorrect?
Can you describe how it bombs?
Is the problem on windows, linux or both?
-JJR |
|
Back to top |
|
|
h3r3tic
Joined: 30 Mar 2004 Posts: 261 Location: Torun, Poland
|
Posted: Sat Sep 24, 2005 3:10 am Post subject: |
|
|
Haha. I guess you haven't read the code I had posted
Code: |
glCopyTexImage1D = cast(pfglCopyTexImage1D)getProc("glTexImage1D"); |
Hmmm... let's see...
glCopyTexImage1D vs "glTexImage1D"
I guess these are two different functions Really, you should just try calling glCopyTexImageXX and see what happens for yourself Weren't Derelict's dynamic binding functions generated automatically ? Looks like a copy and paste error to me... |
|
Back to top |
|
|
JJR
Joined: 22 Feb 2004 Posts: 1104
|
Posted: Sat Sep 24, 2005 1:18 pm Post subject: |
|
|
Ahem... looks like my observation skills are on the decline. You have to highlight these things for me.
Should be easy enough to clean up, I guess.
Sorry for missing it!
-JJR |
|
Back to top |
|
|
h3r3tic
Joined: 30 Mar 2004 Posts: 261 Location: Torun, Poland
|
Posted: Sun Sep 25, 2005 2:54 am Post subject: |
|
|
Hehe, no problem I just can't see how this bug has been created in the first place |
|
Back to top |
|
|
aldacron
Joined: 05 May 2004 Posts: 1322 Location: Seoul, South Korea
|
Posted: Sun Sep 25, 2005 2:57 am Post subject: |
|
|
The trunk has been updated with the fix. Nice catch.
No automation was used and no animals were harmed in the production of these bindings. |
|
Back to top |
|
|
h3r3tic
Joined: 30 Mar 2004 Posts: 261 Location: Torun, Poland
|
Posted: Sun Sep 25, 2005 3:44 am Post subject: |
|
|
lol
No automation ? Why ? I usually create bindings by running the .h files through a C preprocessor (using standard gcc on Windows), then optionally process them through h2d. The rest is done easily by regular expressions in vim or jEdit.
No animals were harmed ? What about web-spiders ? Ha ! |
|
Back to top |
|
|
JJR
Joined: 22 Feb 2004 Posts: 1104
|
Posted: Sun Sep 25, 2005 5:04 am Post subject: |
|
|
I use MCPP for the preprocessing work. It's an excellent and powerful tool.
Then I use some custom python scripts with regex to do the rest of the dirty work. More reliable results for me anyway.
Animals weren't harmed? What about all those bugs you squashed, Mike? I guess they don't count.
-JJR |
|
Back to top |
|
|
aldacron
Joined: 05 May 2004 Posts: 1322 Location: Seoul, South Korea
|
Posted: Mon Sep 26, 2005 8:09 am Post subject: |
|
|
Considering that no two C projects are guaranteed to follow the same coding conventions, I don't have much faith in automating header conversion. Special cases such as macros and bitfields need to be handled on a case-by-case basis, and it just feels easier to me to go line-by-line through the header and decide how I'm going to handle each line rather than going through parsed output to find the special cases. Do I want to make this #defined constant an int, uint, or byte? What if several related constants would work better wrapped in an enum? Even automation requires going through the results to make sure all is well and correcting things that aren't. Manual conversion is more error prone perhaps (and definitely can be more time consuming), but I prefer it. |
|
Back to top |
|
|
mclysenk
Joined: 28 Oct 2005 Posts: 3
|
Posted: Fri Oct 28, 2005 5:55 pm Post subject: |
|
|
I think glCopyTexImage1D is still broken. In my version, it was accidentally changed to gCopylTexImage1D. |
|
Back to top |
|
|
aldacron
Joined: 05 May 2004 Posts: 1322 Location: Seoul, South Korea
|
Posted: Sat Oct 29, 2005 4:18 pm Post subject: |
|
|
Fixed. |
|
Back to top |
|
|
|