16
Feature requests / Vectors and scalar operators
« on: September 24, 2008, 10:47:53 pm »
Only normalize is missing (really), and I don't know why you'd need those in SFML.
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.
GLuint Texture = SOIL_load_OGL_texture(
"filename.ext",
SOIL_LOAD_AUTO,
SOIL_CREATE_NEW_ID,
SOIL_FLAGS);
ok so far so good, now when i want some kind of breakout clone, how can i manage collision and visibility for each brick?
i dont know how to manage more than 3 objects ^^
does anyone know maybe a good site with example code?
const int WindowX = 800;
const int WindowY = 600;
//Assuming your window goes from 0,0 to 800,600
sf::Sprite Bricks[64] = {...} // I assume you'd set there position somewhere
int InView(sf::Sprite& Arg)
{
//compare to window view
if(Arg.X > WindowX || Arg.X <0)
return 0;
if(Arg.Y > WindowY || Arg.Y < 0)
return 0;
if(Arg.Y < WindowY && Arg.Y > 0)
return 1;
if(Arg.X < WindowX && Arg.X > 0)
return 1;
}
//... somewhere in render-loop
for(int i = 0; i <= 64; i++) //++i?
{
if(InView(Bricks[i]))
{
//draw
}
}
Ah yes... well, SFML doesn't use many OpenGL accelerations from what I have seen (or even DXT compression?), so such conclusions are premature considering SFML's age when compared to SDL.
As you can see sprites drawing without alpha using SDL is faster then using SFML.