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

OpenLayer port

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



Joined: 03 Mar 2006
Posts: 203

PostPosted: Sun Apr 02, 2006 4:30 pm    Post subject: OpenLayer port Reply with quote

Meh, forget SGE Razz

OpenLayer is a very good/easy to use OpenGL library for doing 2D graphics (rotations, alpha, lines/circles etc.). I'd like to see (or port myself) this to D/derelict. Could you see this being added to Derelict?

http://retrospec.sgn.net/~openlayer/
Back to top
View user's profile Send private message
clayasaurus



Joined: 21 May 2004
Posts: 857

PostPosted: Sun Apr 02, 2006 9:07 pm    Post subject: Re: OpenLayer port Reply with quote

This project is probably too specific and/or not useful/popular enough for derelict. If the liscense allows, you should make a native D port for it.
Back to top
View user's profile Send private message AIM Address
Phr00t



Joined: 03 Mar 2006
Posts: 203

PostPosted: Mon Apr 03, 2006 9:41 pm    Post subject: Reply with quote

Hrm... that SDL_gfx library is the functionality I am looking for... but the problem is: after doing all that porting, you are left with a library that is too slow compared to OpenGL's zooming/rotation/alpha etc. support.. so why didn't we spend that time making an OpenGL gfx port with the same functionality?

I have used OpenLayer before on some C++ projects, it is popular among Allegro fans (which is like SDL). I plan to bring over primitives/blitting functions -- I already have lines/circles/colors working, next step is to get blits to work (which will be more difficult)

I'm sure someone already has mastered the art of loading graphic files and displaying them in a 2D manner on-screen, so if you want to post your code, that would be awesome Smile
Back to top
View user's profile Send private message
clayasaurus



Joined: 21 May 2004
Posts: 857

PostPosted: Tue Apr 04, 2006 10:30 am    Post subject: Reply with quote

I'm working on a 2D Game Library that uses OpenGL for rendering, you can make feature requests and then wait until the summer and I can get them in Razz . Here is what I have so far. (note: the docs are slightly outdated, it is schooltime so I don't have time for the project currently).

http://warbots.dsource.org/arc/index.html

Basic feature list
* input and window handling
* frames with box, radius, and per pixel collision
* rotozoom SDL surfaces
* Texturing SDL surface --> OpenGL texture
* Particle engine that uses lua for configuration
* font rendering
* serialization (save/load)
* loading an animation given 1 giant picture with 'prison cells' for each character

I'm not sure if this will be of any help to you. Any feature requests? Cool
Back to top
View user's profile Send private message AIM Address
Phr00t



Joined: 03 Mar 2006
Posts: 203

PostPosted: Tue Apr 04, 2006 1:14 pm    Post subject: Reply with quote

I think what you are working on is what I am looking for -- your "entity" class is something of a 'sprite' class

Features -- simple line/circle/rectangle eg. drawing Smile This is pretty simple so it shouldn't be hard to implement (I've done it myself, but it should be included)

Do you have an SVN for this project? I wouldn't mind helping you out with the project when I have time Smile

Where can I download your library so I can play with it -- do you have an example program?

[ edit ] Can I create a window without using a Lua script? What if I just want to open a window (640, 480, 16-bit color, fullscreen) ... I don't want a user to edit a script to set these numbers, or I want to setup these numbers in the code/on a menu...?

[ edit2 ] ahh found the SVN
Back to top
View user's profile Send private message
clayasaurus



Joined: 21 May 2004
Posts: 857

PostPosted: Tue Apr 04, 2006 5:10 pm    Post subject: Reply with quote

Phr00t wrote:
I think what you are working on is what I am looking for -- your "entity" class is something of a 'sprite' class


I use entity simply as a base class for all graphical objects, so I can have an array of entity's and have them become whatever I want. I think my 'frame' is the most similar to your 'sprite' class, I have 3 different types of frames for 3 different types of collision detections, but they all share the base class 'frame.'

Quote:

Features -- simple line/circle/rectangle eg. drawing Smile This is pretty simple so it shouldn't be hard to implement (I've done it myself, but it should be included)


Those should be easy.

Quote:

Do you have an SVN for this project? I wouldn't mind helping you out with the project when I have time Smile


Are you a windows user? DLL's are here --> http://www.dsource.org/projects/warbots/browser/downloads/dll

Source code for Arc is here -->
http://www.dsource.org/projects/warbots/browser/trunk/arc

Quote:

Where can I download your library so I can play with it -- do you have an example program?


I have a pong game, I'll try to update it to the latest version of arc. You should also note the docs are slightly out of date.

Quote:

[ edit ] Can I create a window without using a Lua script? What if I just want to open a window (640, 480, 16-bit color, fullscreen) ... I don't want a user to edit a script to set these numbers, or I want to setup these numbers in the code/on a menu...?


I want lua to be the configuration language of my 2d game lib, but yes I could very easily make the window work without lua.

Just note: I used to develop this on linux, but I've been forced to use windows recently so I've been using Poseidon on dsource as my editor.

Here's what I'll try to get done tonight for you:

* make my pong game work on the current version of arc
* update documentation of arc
* compiler version switch to not use lua if desired
* planned primitives for module arc.gfx.prim;
Code:

void drawLine(int x1, int y1, int x2, int y2, int R, int G, int B);
//note: detail will be how many vertex's to be used to draw circle
// ex - a detail of '3' will draw an equilateral triangle
void drawCircle(int centerX, int centerY, int radius, int detail, int R, int G, int B, bool filled);
void drawRect(int x, int y, int width, int height, int R, int G, int B, bool filled);


I can also write the functions as
Code:

void drawRect(Point pos, Point size, int R, int G, int B, bool filled)
or
void drawRect(int x, int y, int width, int height, Color color, bool filled)
or
void drawRect(Point pos, Point size, Color color, bool filled)


but it gets tiring to write 3 permutations for 1 simple function.

Any more graphics primitives needed?
Back to top
View user's profile Send private message AIM Address
Phr00t



Joined: 03 Mar 2006
Posts: 203

PostPosted: Tue Apr 04, 2006 5:43 pm    Post subject: Reply with quote

Quote:
I use entity simply as a base class for all graphical objects, so I can have an array of entity's and have them become whatever I want. I think my 'frame' is the most similar to your 'sprite' class, I have 3 different types of frames for 3 different types of collision detections, but they all share the base class 'frame.'


Hrm... is there much un-needed overhead when creating 'frames' that you are not going to use any collision detection with? (for instance, you could want to have a "button" frame that you will just click)

I checked-out your /arc/ stuffs and put it in my /dmd/import directory, so I should be able to use it Smile I assume your updates will be reflected in the SVN repository

Quote:
I have a pong game, I'll try to update it to the latest version of arc. You should also note the docs are slightly out of date.


I'll have to check-out your pong game to check it out Wink I noticed the docs were out-of-sync when I was browsing your source tree Smile

Quote:
Just note: I used to develop this on linux, but I've been forced to use windows recently so I've been using Poseidon on dsource as my editor.


I'm a Windows user, and I really like Poseidon -- it is some good stuff. Smile

Stick with the easiest functions with "int" args, and only have 1 function for each primitive. Oh yes, of course, can't forget the "point" primitive Smile It just draws a pixel of color C at X, Y (much like a line of length 0.5)

I'm not sure if you have this yet or not, but support TTF through FreeType fonts (or something) for your text rendering?

Also -- your soundFX library... "open()" should be something more like "SoundFXInit(int sample_rate, ... )" kinda function.

[ edit ] awww i see, you do arc.soundfx.open kinda thing... thats OK

Your GUI looks pretty interesting too Smile keep up the work, I'd love to help when I have the time -- let me know if you need it
Back to top
View user's profile Send private message
clayasaurus



Joined: 21 May 2004
Posts: 857

PostPosted: Tue Apr 04, 2006 9:45 pm    Post subject: Reply with quote

My latest reply can be found here http://www.dsource.org/forums/viewtopic.php?p=8682#8682 , as the discussion currently has nothing to do with derelict anymore.
Back to top
View user's profile Send private message AIM Address
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