FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Bug in DerelictGL

 
Post new topic   Reply to topic     Forum Index -> Derelict
View previous topic :: View next topic  
Author Message
h3r3tic



Joined: 30 Mar 2004
Posts: 261
Location: Torun, Poland

PostPosted: Fri Sep 23, 2005 6:57 am    Post subject: Bug in DerelictGL Reply with quote

Hi there. A few functions in DerelictGL are loaded incorrectly. Caused a few nice crashes and a whole lot of confusion Wink

Code:

    glCopyTexImage1D    = cast(pfglCopyTexImage1D)getProc("glTexImage1D");
    glCopyTexImage2D    = cast(pfglCopyTexImage2D)getProc("glTexImage2D");
    glCopyTexSubImage1D = cast(pfglCopyTexSubImage1D)getProc("glTexSubImage1D");
    glCopyTexSubImage2D = cast(pfglCopyTexSubImage2D)getProc("glTexSubImage2D");
Back to top
View user's profile Send private message MSN Messenger
JJR



Joined: 22 Feb 2004
Posts: 1104

PostPosted: Fri Sep 23, 2005 8:39 pm    Post subject: Reply with quote

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
View user's profile Send private message
h3r3tic



Joined: 30 Mar 2004
Posts: 261
Location: Torun, Poland

PostPosted: Sat Sep 24, 2005 3:10 am    Post subject: Reply with quote

Haha. I guess you haven't read the code I had posted Very Happy

Code:

glCopyTexImage1D    = cast(pfglCopyTexImage1D)getProc("glTexImage1D");


Hmmm... let's see...
glCopyTexImage1D vs "glTexImage1D"

I guess these are two different functions Laughing Really, you should just try calling glCopyTexImageXX and see what happens for yourself Wink Weren't Derelict's dynamic binding functions generated automatically ? Looks like a copy and paste error to me...
Back to top
View user's profile Send private message MSN Messenger
JJR



Joined: 22 Feb 2004
Posts: 1104

PostPosted: Sat Sep 24, 2005 1:18 pm    Post subject: Reply with quote

Embarassed

Ahem... looks like my observation skills are on the decline. You have to highlight these things for me. Razz

Should be easy enough to clean up, I guess.

Sorry for missing it!

-JJR
Back to top
View user's profile Send private message
h3r3tic



Joined: 30 Mar 2004
Posts: 261
Location: Torun, Poland

PostPosted: Sun Sep 25, 2005 2:54 am    Post subject: Reply with quote

Hehe, no problem Smile I just can't see how this bug has been created in the first place Shocked
Back to top
View user's profile Send private message MSN Messenger
aldacron



Joined: 05 May 2004
Posts: 1322
Location: Seoul, South Korea

PostPosted: Sun Sep 25, 2005 2:57 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
h3r3tic



Joined: 30 Mar 2004
Posts: 261
Location: Torun, Poland

PostPosted: Sun Sep 25, 2005 3:44 am    Post subject: Reply with quote

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
View user's profile Send private message MSN Messenger
JJR



Joined: 22 Feb 2004
Posts: 1104

PostPosted: Sun Sep 25, 2005 5:04 am    Post subject: Reply with quote

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. Cool

-JJR
Back to top
View user's profile Send private message
aldacron



Joined: 05 May 2004
Posts: 1322
Location: Seoul, South Korea

PostPosted: Mon Sep 26, 2005 8:09 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
mclysenk



Joined: 28 Oct 2005
Posts: 3

PostPosted: Fri Oct 28, 2005 5:55 pm    Post subject: Reply with quote

I think glCopyTexImage1D is still broken. In my version, it was accidentally changed to gCopylTexImage1D.
Back to top
View user's profile Send private message
aldacron



Joined: 05 May 2004
Posts: 1322
Location: Seoul, South Korea

PostPosted: Sat Oct 29, 2005 4:18 pm    Post subject: Reply with quote

Fixed.
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> Derelict All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group