Easy GL2D

Got something cool to help make the toolchains better? Post it here.

Should libgl2d be integrated into libnds? http://devkitpro.org/viewtopic.php?p=6893#p6893

Yes, integrate it immediately if not sooner.
41
40%
No, let's have this as a separate library and work towards middleware.
20
20%
Let's do both - integrate it as is and build an abstraction layer on top.
17
17%
I'm good with whatever is decided.
24
24%
 
Total votes: 102

User avatar
Izhido
Posts: 107
Joined: Fri Oct 19, 2007 10:57 pm
Location: Costa Rica
Contact:

Re: Easy GL2D

Post by Izhido » Sat Feb 19, 2011 9:52 pm

Yeah. 512KB should be enough for anybody. :)

To be honest, I don't like the idea of integrating a library designed for a specific purpose, mixing various kinds of DS hardware, into libnds. The current model we have with, say, the WiFi lib, libfat, even libfilesystem, has worked just fine till now. I like the idea of GL2D as a separate, static library just like these ones. Hell, I would even like to see the current 3D API detached from libnds, so we can easily choose our favorite implementation...

Just my 2c .

zeromus
Posts: 212
Joined: Wed Mar 31, 2010 6:05 pm

Re: Easy GL2D

Post by zeromus » Sat Feb 19, 2011 11:58 pm

my vote is to rename functions to gl2dRelminatorsFunction and integrate it. I would rather help people use this than try to explain BG and OAM and vram mapping to them.

relminator
Posts: 84
Joined: Sun Apr 11, 2010 10:43 am

Re: Easy GL2D

Post by relminator » Sun Feb 20, 2011 5:13 pm

if GL2D gets integrated, I'll prolly just keep glSprite() for speed, and do a glSpriteRotateScale() that can be a generic function for all sprite needs so as not to pollute the global namespace.

What do you guys think?

eradsoft
Posts: 30
Joined: Fri Dec 17, 2010 1:34 pm
Location: Either side of South Bypass, Madrid, Spain

Re: Easy GL2D

Post by eradsoft » Mon Feb 21, 2011 12:53 pm

Very interesting discussion: I´m getting lost
Just a small question to the authors:
To put sprites at different depths I asume you just has to say
glTraslate(0,0, whateverZyouwant);
glSprite(...)
Am I right???
--------------------------------
Welcome, my son, to the machine.
Pink Floyd.

WinterMute
Site Admin
Posts: 1845
Joined: Tue Aug 09, 2005 3:21 am
Location: UK
Contact:

Re: Easy GL2D

Post by WinterMute » Mon Feb 21, 2011 1:54 pm

Izhido wrote:Yeah. 512KB should be enough for anybody. :)

To be honest, I don't like the idea of integrating a library designed for a specific purpose, mixing various kinds of DS hardware, into libnds. The current model we have with, say, the WiFi lib, libfat, even libfilesystem, has worked just fine till now. I like the idea of GL2D as a separate, static library just like these ones. Hell, I would even like to see the current 3D API detached from libnds, so we can easily choose our favorite implementation...

Just my 2c .
There's nothing stopping you from using your favourite implementation now. That's the thing about libraries, the linker doesn't link in things you don't ask for. We could probably aim for more granularity in the libraries we have but libnds is still, at it's heart, a thin layer over the hardware.

One of the biggest problems we have with novice coders is that horrible third party libraries provide things that we currently don't have an implementation for, things like a reasonable API for making 2D games with the 3D hardware. For people just starting out choice is actually a bad thing, usually they don't have the experience to help them choose the right approach.
Help keep devkitPro toolchains free, Donate today

Personal Blog

relminator
Posts: 84
Joined: Sun Apr 11, 2010 10:43 am

Re: Easy GL2D

Post by relminator » Wed Feb 23, 2011 6:26 am

eradsoft wrote:Very interesting discussion: I´m getting lost
Just a small question to the authors:
To put sprites at different depths I asume you just has to say
glTraslate(0,0, whateverZyouwant);
glSprite(...)
Am I right???
No. Depth management is handled automatically by the library. Just call glSprite() and you're good to go.

ENAY
Posts: 15
Joined: Mon Aug 16, 2010 7:29 am
Location: Japan

Re: Easy GL2D

Post by ENAY » Wed Feb 23, 2011 5:48 pm

Sorry about the delay. Urgent business came in over the weekend so I've been tied up on other things pretty much all week :(

I will try glDeleteTexture later and see what happens. Thanks for that Relminator. Looks like I still have a lot to learn.

Thanks for your interest Relminator :) I was only originally dabbling about on the DS for experimental purposes, but since I have been progressing well I may as well finish what I started. Once my game is done I may consider releasing it for free, need to check with my publisher first to see if that is actually ok or not since it is a conversion of one of my old PC games.

A few weeks ago I went to Osaka with my girlfriend and we visited the famous Osaka aquarium. Inside the building it had Nintendo DS wifi points set up all over the museum and simply standing by various numbered areas allowed you to download audio files to listen too. (As if you were using headphones) There were also pictures/texts maps etc of various things.

Very impressive stuff! I would love to know how they did that. :mrgreen:

defer
Posts: 3
Joined: Sat Feb 26, 2011 7:15 pm

Re: Easy GL2D

Post by defer » Sat Feb 26, 2011 7:29 pm

Nice library.
I've added glLoadOneTile() to load any tile, without the limitation on size that glLoadTileSet() has. Patch attached.

Also I was wondering why glLoadSpriteSet() and glLoadTileSet() are return the textureID. Is that of any use ?
Attachments
glLoadOneTile.diff.zip
(930 Bytes) Downloaded 1172 times

relminator
Posts: 84
Joined: Sun Apr 11, 2010 10:43 am

Re: Easy GL2D

Post by relminator » Mon Feb 28, 2011 8:00 am

glLoadTileset() can load single tiles. Just use the same tilesize and bmpsize in your parameters and it would load a single tile.

You can use the returned textureID to delete your textures at runtime. ie. Dynamic textures.

defer
Posts: 3
Joined: Sat Feb 26, 2011 7:15 pm

Re: Easy GL2D

Post by defer » Tue Mar 01, 2011 3:19 am

relminator wrote:glLoadTileset() can load single tiles. Just use the same tilesize and bmpsize in your parameters and it would load a single tile.
Indeed (and it's obvious my new function doesn't add anything). I think I fixed another issue in my code at the same time I wrote that.
relminator wrote:You can use the returned textureID to delete your textures at runtime. ie. Dynamic textures.
Thanks.

Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests