Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - RixCoder

Pages: [1]
1
Graphics / Use of SOIL and SFML
« on: September 26, 2009, 08:11:42 am »
I want to experiment with a point sprite particle engine. Since I can't really define such behavior for sfml sprite objects, which is fine, I figured I would just find an easy image loading library and just do things manually easy enough.
So I found SOIL. Sweet. Figure i'll use sfml for the render window setup and just write everything else manually through openGL calls using SOIL to load my images.

Well, SFML uses SOIL inside of it ( didn't know that before ) so if I try to include soil.h with it's library linked in the project, I get linker errors for it already being defined.
So I remove the header and linked library thinking "ok, sfml already has this included inside it for me ". But,  if I try to use the example functions from soil's tutorial to load an image it doesn't recognize any of them.

So basically am I stuck now? Its seems trying to include soil manually into the project causes linker errors, and without including it, the project doesn't recognize functions that it should from the soil library.

Im using SFML 1.5 ( static libraries )

E: Is it at all possible to use sf::image and bind that manually for use within a point sprite system?

2
SFML projects / Vector Math Library
« on: September 19, 2009, 07:03:12 am »
Since I've seen people request vector math functionality built into sfml a few times I created a simple header file to include into the projects that should do just that.

Its just a namespace packed with templated functions for handling just about all of the operations you should need, overloaded for both 2D and 3D sfml vectors.

Some functions included:
Length
Normalize
Rotate ( 2D vector only )
Angle Between 2 vectors ( functions for both radians and degrees )
Dot Product
Cross Product

Some other random stuff:
functions for converting degrees to radians and vice-versa

to use simply include the header file in your project
example of use:
Code: [Select]
#include "RixMath.h"

sf::vector2f v1(10, 1);
sf::vector2f v2(1, 20);
 float result = sfm::Dot(v1, v2);


you can catch a link to the header file HERE

Enjoy =)

If there are any problems let me know and please give credit if used in your project!

3
Graphics / Set my own blendfunc on a sprite object
« on: September 19, 2009, 05:47:45 am »
Is it possible to render a loaded sf::sprite object with my own openGL blendfunc without it defaulting to one of the predefined blend options provided in sf::blend automatically?

4
Graphics / openGL + SFML window question
« on: September 16, 2009, 02:52:23 am »
I'm more or less curious as to how the normal 2d calls for drawing to a renderwindow work in tandem with just plain openGL calls.

For example im working on doing a dynamic 2D shadow system for my next project and I noticed that if the plain openGL calls are not the last thing to be called they don't appear to render or maybe getting discarded somewhere?

Is there a way to draw openGL primitives ( like in my case a triangle strip ) than draw normal 2D sfml draw calls over it?

Code Ex: This works
Code: [Select]
for(unsigned int i = 0; i < m_FrontList.size(); ++i)
m_pGameWindow.Draw(*m_FrontList[i].DrawObj.first);

glBegin(GL_TRIANGLE_STRIP);
for(unsigned int i = 0; i < m_TriangleFan.size(); ++i)
{
for(unsigned int k = 0; k < m_TriangleFan[i].m_Points.size(); ++k)
{
glVertex2f(m_TriangleFan[i].m_Points[k].x, m_TriangleFan[i].m_Points[k].y);
}
}
glEnd();


This Does not!
Code: [Select]


glBegin(GL_TRIANGLE_STRIP);
for(unsigned int i = 0; i < m_TriangleFan.size(); ++i)
{
for(unsigned int k = 0; k < m_TriangleFan[i].m_Points.size(); ++k)
{
glVertex2f(m_TriangleFan[i].m_Points[k].x, m_TriangleFan[i].m_Points[k].y);
}
}
glEnd();
for(unsigned int i = 0; i < m_FrontList.size(); ++i)
m_pGameWindow.Draw(*m_FrontList[i].DrawObj.first);

5
SFML projects / Short n Sweet 2D Space Shooter Action
« on: September 13, 2009, 01:30:47 am »
This was a team project put together from individuals from the IGDA scene here in New York City! It has around 13 days of total work put into it and is the first project I have ever used SFML in and I gotta say, SFML has been an utter joy to work with so far. I look forward to using it on our next project currently in the works!

Enough jibber-jabber! You can get the game HERE!

EDIT:
Grab the full sloppy source at:
My Website

6
System / How does SFML handle deletion?
« on: September 01, 2009, 07:50:19 pm »
I created a resource manager in which I have my own templated new function that basically returns a pointer to the created object and stores the pointer of it in a list. in the resource manager's destructor it goes through the list of pointers it stored and deletes them all.

Problems are arising now that im crashing on exit. The last thing in my call stack is this:

Code: [Select]

> Jumpstart.exe!std::_Tree<std::_Tset_traits<sf::ResourcePtr<sf::Image> *,std::less<sf::ResourcePtr<sf::Image> *>,std::allocator<sf::ResourcePtr<sf::Image> *>,0> >::_Eqrange(sf::ResourcePtr<sf::Image> * const & _Keyval=0x0079d7d0)  Line 1133 + 0x8 bytes C++

EDIT: scratch that, even manual calls make it crash =p Is the resourcePointer generated for images and sound buffers self-cleaning?

Also is guessing theres no leaks coming out of sfml though CRT leak checking still reports a couple tiny leaks on exit even though i fully delete all new objects created. Any ideas?

7
Graphics / SFML 1.5 PostFX problem ( ATI vs. Nvidia )
« on: August 29, 2009, 10:40:02 pm »
I have a problem going on right now and im sure its not an issue with sfml exactly but rather compiler differences between ATI and Nvidia for handling shaders.

But maybe someone here can point out a potential solution.

Right now I have the following FX code:
Code: [Select]

texture framebuffer
vec2 centerXY
float offset

effect
{
float len = distance(_in, centerXY) * offset;
if (len < (0.3f) && len > 0.1f)
_out = framebuffer(_in + (_in - centerXY) * len);
else
_out = framebuffer(_in);
}


now, centerXY is the ship's position being passed in and offset is the rate of expansion of a "shockwave" effect.

On an radeon mobility x1600 the shockwave effect works perfectly but position information is wonky, it offsets itself above where it should be spawning ( so its offset in the Y by an incorrect amount )

On an nvidia geforce go 7400 the effect comes out oval in shape but renders in the correct position always.

Its really hard finding information on this anywhere and it seems even having comments in one shader file works on the nvidia card but not the ATI card :shock: .

If anyone can help with this it would be greatly appreciated. Thanks in advance  :D

Pages: [1]