indielib.com

IndieLib Forum
It is currently Sun Dec 16, 2018 7:41 am

All times are UTC




Post new topic Reply to topic  [ 45 posts ]  Go to page 1, 2, 3  Next
Author Message
PostPosted: Fri Jan 02, 2009 5:07 pm 
Offline
Site Admin
User avatar

Joined: Wed Dec 26, 2007 1:38 am
Posts: 626
Location: Murcia, Spain
IndieLib 1.03 SDK

Fairly innocuous but helpful bug fix release.


Fairly innocuous but helpful bug fix release.

[ features ]

+ Added Render::BlitColoredTriangle () method, for rendering triangles with differen color for each of the faces.

[ bug fixes ]

+ Fixed some color glitches on Primitives.

+ Fixed wrong name in GetPosZ().

+ Fixed return value on IND_Entity2dManager::Delete ().


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jan 03, 2009 12:42 pm 
Offline
Site Admin
User avatar

Joined: Wed Dec 26, 2007 1:38 am
Posts: 626
Location: Murcia, Spain
Hi people!

Render->BlitColoredTriangle ()

Was a method really easy to implement. I don't now why it wasn't already on the engine. It just draws a triangle, and let you choose the color of each of its corners. You can also set a level of transparency for the whole triangle.

TODO:

1. Add it to the primitives tutorial
2. Add it to Entity2d, you can't add it to an entity yet (in the documentation it is wrong)

I want to ask you:

1. Do you think it would be helpful to be able to choose the amount of transparency per corner (for having gradients of transparency). Currently the transparency affects to the whole triangle.
2. Do you think should we create a wrapper for letting use vertex arrays, etc? I think it is not neccesary because you can directly get the pointer to direct3d and use it as you wish. But maybe, thinking in future portability it would be neccesary...
3. Do you need something else in primitives?


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jan 03, 2009 4:53 pm 
Offline
User avatar

Joined: Sat Dec 20, 2008 8:46 pm
Posts: 137
Location: Sweden
Disregard this, i didnt know what i was talking about.


Last edited by Metadon on Sun Jan 04, 2009 4:22 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: Sun Jan 04, 2009 12:15 pm 
Offline
Site Admin
User avatar

Joined: Wed Dec 26, 2007 1:38 am
Posts: 626
Location: Murcia, Spain
Quote:
While i dont really see the need for BlitColoredTriangle as you could already do the same thing with three blitline, i guess it might by useful for some.


In fact, is a filled triangle.

Quote:
I really want a filled polygon function.


This is what it is :)

Maybe I should change the name of this method?


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jan 04, 2009 12:34 pm 
Offline
User avatar

Joined: Sat Dec 20, 2008 8:46 pm
Posts: 137
Location: Sweden
Oh, whoops. Disregard what i said then. :oops:

In that case, yes, separate transparencies for corners would be neat.

If you could add a filled triangle with only one colour instead of three, that would also be neat.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jan 04, 2009 12:42 pm 
Offline
Site Admin
User avatar

Joined: Wed Dec 26, 2007 1:38 am
Posts: 626
Location: Murcia, Spain
Quote:
separate transparencies for corners would be neat.


That not complex, but I bit tricky because I'll have to change some details. But don't worry, I'll add it :)

Quote:
If you could add a filled triangle with only one colour instead of three, that would also be neat.


Easy and helpful method, yes, I'll add it too.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jan 04, 2009 3:49 pm 
Offline
User avatar

Joined: Sat Dec 20, 2008 8:46 pm
Posts: 137
Location: Sweden
The alpha value in blitcoloredtriangle doesnt seem to affect anything.

This;
Code:
mI->Render->BlitColoredTriangle(0,0,80,40,-80,40,100,100,100,100,100,100,100,100,100,255);

and this;
Code:
mI->Render->BlitColoredTriangle(0,0,80,40,-80,40,100,100,100,100,100,100,100,100,100,0);

looks exactly the same, am i doing something wrong or is it a bug?


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jan 04, 2009 3:53 pm 
Offline
Site Admin
User avatar

Joined: Wed Dec 26, 2007 1:38 am
Posts: 626
Location: Murcia, Spain
There is something wrong, yes. It seems like alpha is not affecting primitives any more.

I'll take a look. I think I know what it is.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jan 04, 2009 4:27 pm 
Offline
User avatar

Joined: Sat Dec 20, 2008 8:46 pm
Posts: 137
Location: Sweden
Great, that bug is pretty annoying.

A question, is it possible to use blendmodes with primitives? If it is, support for using that would be awesome for some particular uses.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 08, 2009 8:31 am 
Offline
Site Admin
User avatar

Joined: Wed Dec 26, 2007 1:38 am
Posts: 626
Location: Murcia, Spain
TODO:

1. Add BlitColoredTriangle to the primitives tutorial
2. Add it to Entity2d, you can't add it to an entity yet (in the documentation it is wrong)
3. Change the names of collision system methods.
4. Splines
5. Check out if there is a problem the second time of calling an animation
6. Resizable window
7. Map editor tutorial
8. Possibility of checking focus lost.
9. SetMousePos
10. Currently, entities can not share animations. Well, they can share it, but if you make a "SetSequence" it will be done in all the entities that share that animation. I have to add a "Clone Animation" method for that. This is going to be in the very next release. It's really important.

Hey! No one here knows OpenGl / Direct3d? I'm starting to have too much work :)

An english speaker would be also really welcome. He / she only would have to read the sourcecode, fix English errors, and press "commit" :)


Last edited by Javier López on Thu Jan 22, 2009 6:48 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 08, 2009 6:15 pm 
Offline
User avatar

Joined: Sat Dec 20, 2008 8:46 pm
Posts: 137
Location: Sweden
English isnt my first language, obviously, but i could proof-read the sourcecode every once in a while if it would help. Im afraid i cant help you with Direct3d/OpenGL since i have close to zero experience with them.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 08, 2009 6:50 pm 
Offline
Site Admin
User avatar

Joined: Wed Dec 26, 2007 1:38 am
Posts: 626
Location: Murcia, Spain
Quote:
English isnt my first language, obviously, but i could proof-read the sourcecode every once in a while if it would help.


This would be great if you have some time. You can access de Assembla repository: http://www.indielib.com/forum/viewtopic.php?t=48

But don't worry, I think you are making the BEST thing that this community needs now: rapid game development :)

So keep doing what you are just doing :)


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 22, 2009 4:30 am 
Offline
User avatar

Joined: Wed Jan 21, 2009 4:36 pm
Posts: 209
Location: San Diego, CA
I hope I'm not way off here and outstepping my bounds because I just downloaded the library today but I've found memory leaks.


In the End function of the main class that the game creates I did this to clean things up.

void CIndieLib::End()
{
// ----- Freeing objects -----

Math ->End();
MeshManager ->End();
Input ->End();
Entity2dManager ->End();
Entity3dManager ->End();
FontManager ->End();
AnimationManager ->End();
SurfaceManager ->End();
ImageManager ->End();
LightManager ->End();
Render ->End();
Window ->End();

delete Math;
delete MeshManager;
delete Input;
delete Entity2dManager;
delete Entity3dManager;
delete FontManager;
delete AnimationManager;
delete SurfaceManager;
delete ImageManager;
delete LightManager;
delete Render;
delete Window;

IndieLib::End ();

delete pinstance;
pinstance = NULL;
}

I used the CRT to find them. Now some people may disagree with me and point out that since we are shutting down the app that the OS will clean up the memory for us. I guess you can consider me a purist but I hate to leave memory hanging around for the OS to catch. I like to close apps all nice and tidy. :)

Put this at the beginning of your "main" or IndieLib function.

// Enable run-time memory check for debug builds.
#if defined(DEBUG) | defined(_DEBUG)
// Always perform a leak check just before app exits.
int nDbgFlags = _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG);
nDbgFlags |= _CRTDBG_LEAK_CHECK_DF;
nDbgFlags |= _CRTDBG_ALLOC_MEM_DF;
_CrtSetDbgFlag(nDbgFlags);
#endif

and you'll see "Dumping Objects..." in the output window after the app shuts down.

Regards,
Steve


Last edited by smjones_gi on Thu Jan 22, 2009 9:18 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 22, 2009 6:50 pm 
Offline
Site Admin
User avatar

Joined: Wed Dec 26, 2007 1:38 am
Posts: 626
Location: Murcia, Spain
Thank you very much for finding this. This is similar to what Black Bird found.

I have updated the TODO list for the new bug fixing release:

1. Add BlitColoredTriangle to the primitives tutorial
2. Add it to Entity2d, you can't add it to an entity yet (in the documentation it is wrong)
3. Change the names of collision system methods.
4. Splines
5. Check out if there is a problem the second time of calling an animation
6. Resizable window
7. Map editor tutorial
8. Possibility of checking focus lost.
9. SetMousePos
10. Currently, entities can not share animations. Well, they can share it, but if you make a "SetSequence" it will be done in all the entities that share that animation. I have to add a "Clone Animation" method for that. This is going to be in the very next release. It's really important.
11. Fix memory leaks when ending IndieLib.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 23, 2009 11:22 pm 
Offline
User avatar

Joined: Wed Jan 21, 2009 4:36 pm
Posts: 209
Location: San Diego, CA
IND_Render::GetFpsString () { char *mString = new char [128]; itoa (mLastFps, mString, 10); return mString; }

Gives memory leaks! Lots of them. :) See that 'new' operator?

I saw this occur when my memory leak dump was huge. Is there anywhere where this is cleaned up that I missed?

Regards,
Steve


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 45 posts ]  Go to page 1, 2, 3  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 0 guests


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 post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group