[QUOTE=Darwin226;27629379]Are you sure the coordinates aren't from 0,0 in the middle to 1,1 in top right?
I haven't read the whole discussion but that might be the problem.[/QUOTE]
I've fixed this by pushing the current projection matrix onto the matrix stack and using glOrtho. Now my rectangle won't move. So I don't know if the coordinates are from 0, 0 to 1, 1.
[cpp]
void RendererImpl::DrawFilledRect(Rect& Rect) {
...
AddVertex(Rect.x, Rect.y);
AddVertex(Rect.x + Rect.Width, Rect.y);
AddVertex(Rect.x, Rect.y + Rect.Height);
AddVertex(Rect.x + Rect.Width, Rect.y);
AddVertex(Rect.x + Rect.Width, Rect.y + Rect.Height);
AddVertex(Rect.x, Rect.y + Rect.Height);
}
void RendererImpl::AddVertex(int x, int y) {
...
m_pVerts[m_VertCount].x = (float)x;
m_pVerts[m_VertCount].y = (float)y;
m_pVerts[m_VertCount].z = 0.5f;
m_pVertsColor[m_VertCount] = m_CurrentColor;
++m_VertCount;
}
[/cpp]
-snip- Never mind.
[url]http://pastebin.com/jzsBtp4e[/url]
What is wrong with my nooby collision detection? :(
It's for a very simple platforming game and when the two things collides the game just crashes..
boost::mutli_array still doesn't work. For some reason, the compiler can't find boost::extents in the header, but can in the .cpp.
Question. In java, I have a function ReadByte() and it reads a byte at buffer[position++] unless positon>buffer.length. In this case, how should I say basicly an arrayoutofboundsexception? I'd prefer not to throw an exception, but is there some way i can return null or something? I can't actually return null because null and byte are incomparable... Anyone? Thanks in advance.
How is "Materials/logo-dark.jpg" not a legal path for a Bitmap?
Wow, uh. Goodbye version one.
Is there any possible reason that I can't get images to load in C# when I'm using OpenGL, as well as when using SFML?
Sorry, you need to Log In to post a reply to this thread.