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

FreeType
Goto page Previous  1, 2
 
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: Wed May 25, 2005 6:01 pm    Post subject: Reply with quote

trevorparscal wrote:
Maybe if one of you guys could do as much automatic stuff to the freetype headers as possible, and give me the results, I could debug and finish it up.


The problem is that there is no tool that will do more than h2d automatically. As for the other stuff - you did very well.

Quote:

Also, they use macros to define the kind of export to use, like DLL or static I think, so the beinging of each function has

EXPORT( type ) funcname(params);

The EXPORT can just be stripped.


But AFAICS, making the function declarations extern(C) is not enough. I had to use:
Code:

version(Windows)
    extern(Windows):
else
    extern(C):


Quote:

here are those defs..

// snip

I think that will save time having that done, even if we throw all my other code out.


I don't understand why should we throw away your code. It looks fine, you can safely continue that way
Back to top
View user's profile Send private message MSN Messenger
JJR



Joined: 22 Feb 2004
Posts: 1104

PostPosted: Wed May 25, 2005 7:07 pm    Post subject: Reply with quote

h3r3tic wrote:
JJR wrote:

Network ran fine? What mode did you use: coLinux Virtual Ethernet Driver (TAP-Win32) or coLinux Bridged Ethernet (WinPcap)? Neither worked for me. But maybe it was trouble using Gentoo.


I used TAP-Win32. Had all my drives mounted through samba, etc. Network worked...


I tried again... total failure. Network setup is a total pain with coop. I have a DSL line hooked into a external NetGear Router (that provides it's own dhcp service) with two computers hooked into that.

The online instructions are horribly disorganized... I managed to get further than before, but now the TAP driver (sharing the main ethernet connection) can't see anything outside. I'm using WinXP HE.

h3r3tic wrote:

Quote:
I'll be trying again shortly. Apparently you can get native win32 opengl support enabled somehow.


I'm already downloading the package 'gentoo-i586-ext3-2g-deluxe.bz2' Twisted Evil


Bleah.... it says in the docs: network setup will either be a breeze or a real pain, possibly taking 6 hours to setup even for an experienced network administrator -- that makes me feel good Sad . It's a real shame. I'm not sure what to try next. Bridging it worked temporarily but only if I activated the bridge manually while running coop linux. I would then have to remove the bridge and reapply it again manually every time I run coop. No other way seems to work ATM.

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



Joined: 22 Feb 2004
Posts: 1104

PostPosted: Wed May 25, 2005 7:27 pm    Post subject: Reply with quote

Ahh.... success. Had to go with the type="bridged" selection to get things working.

Nice to have a fast cross-platform solution on windows. We'll see how possible it is to get fast opengl working as well!

Good for testing cross-platform development. If this works out well, I may let it replace my in system Gentoo installation.

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



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

PostPosted: Wed May 25, 2005 7:29 pm    Post subject: Reply with quote

h3r3tic wrote:

But AFAICS, making the function declarations extern(C) is not enough. I had to use:
Code:

version(Windows)
    extern(Windows):
else
    extern(C):



extern(Windows) is only needed when the C function is declared as __stdcall (or WINAPI). Anything that is default __cdecl (or WINAPIV) should be extern(C). That's why all of the Derelict's OpenGL-related stuff is extern(Windows) while all of the SDL packages are extern(C).

@Trevor - good luck with the FreeType port. Although it's tedious, I prefer doing everything by hand to using automated tools. If all headers were created equal, I wouldn't mind automation. But because there are so many different ways to port so many different headers, I feel more comfortable looking at each one on an individual basis and deciding how to approach it. But I do feel your pain. I once attempted a Derelict binding for Python. I will get around to it again eventually (from a different angle), but it's a bitch.
Back to top
View user's profile Send private message Send e-mail
h3r3tic



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

PostPosted: Wed May 25, 2005 8:07 pm    Post subject: Reply with quote

JJR wrote:
Ahh.... success. Had to go with the type="bridged" selection to get things working.

Nice to have a fast cross-platform solution on windows. We'll see how possible it is to get fast opengl working as well!

Good for testing cross-platform development. If this works out well, I may let it replace my in system Gentoo installation.
-JJR


Congrats ! /* I've just succeeded with a TAP network configuration Smile */
Back to top
View user's profile Send private message MSN Messenger
clayasaurus



Joined: 21 May 2004
Posts: 857

PostPosted: Wed May 25, 2005 9:33 pm    Post subject: Reply with quote

or you could just use SDL *runs away...*
Back to top
View user's profile Send private message AIM Address
trevorparscal



Joined: 25 May 2005
Posts: 73
Location: Bay Area, CA (USA)

PostPosted: Thu May 26, 2005 1:07 am    Post subject: Reply with quote

Ha... yeah, i know its a pain, I will take another stab at it tonight. 77 files.. grrr.. Maybe I will find that the other 74 files are mostly comments... Smile
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
JJR



Joined: 22 Feb 2004
Posts: 1104

PostPosted: Thu May 26, 2005 7:27 am    Post subject: Reply with quote

Trevor,

Sorry, I didn't respond to your last post. I got distracted trying to get coLinux to work.

There's a lot of headers in that freetype library! Like you said, it's a huge amount of work to do by hand. I looked at the headers myself and at least established that the headers are fairly clean and uniform. I really think automation is the answer to this one. I just don't have a tool yet.

Looking at the headers, I don't think you have to remove the macros to correctly parse it. Still it might be safest to run the headers through a preprocessor first as Tom suggested. While I could try using the h2d tool on linux to do the job on the freetype headers, I think in the long run it would be useful to just cook up a script that does the job. Sometimes even making a script that specific to the task at hand beats manually plugging in all the entries.

I really hate to take another project on... since I'm already very busy, but I'll try to see what I can do here. I don't think anyone deserves to experience the horrors of such harsh manual labor. Wink

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



Joined: 25 May 2005
Posts: 73
Location: Bay Area, CA (USA)

PostPosted: Thu May 26, 2005 9:34 am    Post subject: Reply with quote

Yes, freetype is certainly something of a harsh bit of manual labor.

I decided to try and port something smaller, pretty much to practice, and than come back to freetype, in hopes that my positve experience with getting something more simple to work will help me make less mistakes in this large projcect of converting the freetype headers.

I am porting Cpw, or should I say ported Cpw, but I have to work some bugs out still. Once I get that done, I will submit it to bindings or something.. Than move on to greater things, aka freetype.

Any and all help with freetype will be greatly appriciated.

Thanks,
Trevor Parscal
www.trevorparscal.com
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
h3r3tic



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

PostPosted: Thu May 26, 2005 10:19 am    Post subject: Reply with quote

hmm... so if you don't need the whole freetype, you might just code a small wrapper over it in C and port that wrapper to D. wouldn't that be simpler ?
Back to top
View user's profile Send private message MSN Messenger
trevorparscal



Joined: 25 May 2005
Posts: 73
Location: Bay Area, CA (USA)

PostPosted: Thu May 26, 2005 9:00 pm    Post subject: Reply with quote

Yeah, thats what I was considdering doing earlier.. Maybe still..

Eventually I want to be able to use the advanced features of FreeType though...

- Trevor
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> Derelict All times are GMT - 6 Hours
Goto page Previous  1, 2
Page 2 of 2

 
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