1
Graphics / Image::CopyScreen
« on: November 23, 2008, 10:57:22 pm »Quote
It wouldn't make sense, as RenderImage is already an image.
Yes you are right, thanks. I'll wait the update to PostFX
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.
It wouldn't make sense, as RenderImage is already an image.
// Object-to-object bounding-box collision detector:
short int Sprite_Collide(sprite_ptr object1, sprite_ptr object2) {
int left1, left2;
int right1, right2;
int top1, top2;
int bottom1, bottom2;
left1 = object1->x;
left2 = object2->x;
right1 = object1->x + object1->width;
right2 = object2->x + object2->width;
top1 = object1->y;
top2 = object2->y;
bottom1 = object1->y + object1->height;
bottom2 = object2->y + object2->height;
if (bottom1 < top2) return(0);
if (top1 > bottom2) return(0);
if (right1 < left2) return(0);
if (left1 > right2) return(0);
return(1);
};
if(Player.GetPosition().x + Player.GetSize().x <= Wall.GetPosition().x)
{
//not the important part...
if(Player.GetPosition().x <= 1024-Player.GetSize().x) Player.Move( 400*Window.GetFrameTime(), 0);
}
Methods of data movement:
....
- glBegin() / glEnd(): easy to use but bad performance, spoon feeding, multiple layers per call, only a few words of data per API call, function calls are expensive.
....
It isn't the drawing that is the bottleneck, it's the lines that are being generated each frame. You're computing a normal 12 times per asteroid every frame.
GLCheck(glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, myTextureWidth, myTextureHeight, 0, GL_RGBA, GL_UNSIGNED_BYTE, GetPixelsPtr()));
Would you be so kind as to post your code. Thanx.
I guess you're passing a local variable
// Inverts Y-Axis
GetDefaultView().SetFromRect(FloatRect(0,static_cast<float>(myBufferWidth),static_cast<float>(myBufferHeight),0));
SetView(GetDefaultView());
I'd be glad to see your code. I'm especially interested because you're using PBuffers and not FBOs, so you need a high amount of non-portable code.
I'm especially interested because you're using PBuffers and not FBOs
wglQueryPbufferARB(hPBuffer, WGL_PBUFFER_LOST_ARB, &flag);