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.


Messages - Latexi95

Pages: [1]
1
Graphics / How can I use OpenGL commands for drawing on RenderTexture?
« on: January 14, 2012, 11:20:26 pm »
Quote from: "Laurent"
You need to Clear() before drawing, and Display() after.

And does it work if you display a sprite or a shape in your render-texture?

I used Clear and Display().
I think my matrices or something "OpenGL think" is incorrect because drawing after using RenderTexture::Draw() works fine. So how could I apply RenderTexture's View? ApplyCurrentView is private member.  :?

Thank you for helping me.

Edit:
I solved that problem.  :)

2
Graphics / How can I use OpenGL commands for drawing on RenderTexture?
« on: January 14, 2012, 06:44:38 pm »
I would like to use OpenGL commands for drawing on RenderTexture, but just calling RenderTexture::SetActive(true) doesn't seem to work. What am I doing wrong RenderTexture's Draw command works fine.
Code: [Select]
sf::RenderTexture texture;
texture.Create(400,300);
texture.SetActive(true);
glBegin(GL_LINES);
    glColor4ub(color.r,color.g,color.b,color.a);
    glVertex2f(x1,y1);
    glVertex2f(x2,y2);
glEnd();



Sorry about "bad English".

Pages: [1]
anything