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

Proposal: Image type

 
Post new topic   Reply to topic     Forum Index -> ArcLib
View previous topic :: View next topic  
Author Message
Lutger



Joined: 25 May 2006
Posts: 91

PostPosted: Mon Jul 02, 2007 7:13 am    Post subject: Proposal: Image type Reply with quote

I would like to propose or discuss a change to the graphics types in Arc. Perhaps it is not very important and / or high on the priority list, but since it is an API change I thought I'd bring it up before Arc hits it's next release anyway.

The thing is, Sprite and Animation depend on Texture, but this is not an extensible type (struct + free function for drawing). This means that Sprite and Animation is hardcoded to depend on the current behavior of Texture. Say for example you want to use opengl texture coordinates that don't lie in the range 0 - 1, or draw a sprite from vertices, or anything else, then you will have to derive from Sprite and reimplement all the drawing code.

Since all that is needed for Sprite to function is what is in arc.draw.image and the Texture struct, just a couple of functions, it would be easy to be able to override these. In order to do so, one solution is to create a seperate Image type, with an interface preferably, that wraps the functionality of Texture in an object oriented fashion. The types in arc.sprite should then only depend on this Image interface and not on Texture. This way you can get all the nice things that Sprite give you with any type that can draw things, even types created by the user.

So, what do you think?
Back to top
View user's profile Send private message
clayasaurus



Joined: 21 May 2004
Posts: 857

PostPosted: Mon Jul 02, 2007 7:14 pm    Post subject: Reply with quote

I don't think I understand where you are coming from.

Quote:

Sprite and Animation depend on Texture, but this is not an extensible type


I don't understand what there is to extend with an OpenGL texture, it is pretty much just stored as 1 int after loading.

Quote:

you want to use opengl texture coordinates that don't lie in the range 0 - 1


Texture struct has no drawing code in it.. I could just add another drawImage type function to accomplish this, could I not?

Quote:

or draw a sprite from vertices


Hrm... vertex based graphics? Can you maybe give more compelling examples? I'm having a hard time understanding your point of view.

Honestly, the best way to can convince me of a specific feature / api change, is if you /need/ it to write a game. That's how arclib dev operates.
Back to top
View user's profile Send private message AIM Address
Lutger



Joined: 25 May 2006
Posts: 91

PostPosted: Mon Jul 02, 2007 8:06 pm    Post subject: Reply with quote

clayasaurus wrote:


Hrm... vertex based graphics? Can you maybe give more compelling examples? I'm having a hard time understanding your point of view.

Honestly, the best way to can convince me of a specific feature / api change, is if you /need/ it to write a game. That's how arclib dev operates.


I intend to, but have some other projects that take up my time. Look, I didn't intend to demand things here and get it done without reason, if it sounded that way it's not what I meant. I'll revisit the issue when I have undertaken the project of making a game and it comes up.
Back to top
View user's profile Send private message
clayasaurus



Joined: 21 May 2004
Posts: 857

PostPosted: Tue Jul 03, 2007 10:37 am    Post subject: Reply with quote

Quote:

Look, I didn't intend to demand things here and get it done without reason,


I realize that, I'm just having a hard trouble understanding what the feature you want is...

Quote:

'll revisit the issue when I have undertaken the project of making a game and it comes up.


sounds good then, I guess...

~ Clay
Back to top
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> ArcLib 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