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

Author Topic: SFML 2.0 with opengl  (Read 7815 times)

0 Members and 1 Guest are viewing this topic.

vidjogamer

  • Jr. Member
  • **
  • Posts: 67
    • View Profile
SFML 2.0 with opengl
« on: March 12, 2011, 02:01:46 am »
Im using Box2D physics with SFML 2.0. Im using Box2D's opengl debug draw callbacks. Before I switched to SFML 2.0 from 1.6 the callbacks worked properly. After my switch to SFML 2.0 all the debug draw shapes show up as black in color. Whats even stranger is when I spawn new objects to be drawn, the debug draw changes from black to whatever color the image of the new object is. Has anyone else experience anything like this?

Here is the debug draw code:
Code: [Select]

void DebugDraw::DrawPolygon(const b2Vec2* vertices, int32 vertexCount, const b2Color& color)
{
glColor3f(color.r, color.g, color.b);
glBegin(GL_LINE_LOOP);
for (int32 i = 0; i < vertexCount; ++i)
{
glVertex2f(vertices[i].x * PTM_RATIO, vertices[i].y * PTM_RATIO);
}
glEnd();
}

void DebugDraw::DrawSolidPolygon(const b2Vec2* vertices, int32 vertexCount, const b2Color& color)
{
glEnable(GL_BLEND);
glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glColor4f(0.5f * color.r, 0.5f * color.g, 0.5f * color.b, 0.5f);
glBegin(GL_TRIANGLE_FAN);
for (int32 i = 0; i < vertexCount; ++i)
{
glVertex2f(vertices[i].x * PTM_RATIO, vertices[i].y * PTM_RATIO);
}
glEnd();
glDisable(GL_BLEND);

glColor4f(color.r, color.g, color.b, 1.0f);
glBegin(GL_LINE_LOOP);
for (int32 i = 0; i < vertexCount; ++i)
{
glVertex2f(vertices[i].x * PTM_RATIO, vertices[i].y * PTM_RATIO);
}
glEnd();

}

void DebugDraw::DrawCircle(const b2Vec2& center, float32 radius, const b2Color& color)
{
const float32 k_segments = 16.0f;
const float32 k_increment = 2.0f * b2_pi / k_segments;
float32 theta = 0.0f;
glColor3f(color.r, color.g, color.b);
glBegin(GL_LINE_LOOP);
for (int32 i = 0; i < k_segments; ++i)
{
b2Vec2 v = center + radius * b2Vec2(cosf(theta), sinf(theta));
glVertex2f(v.x * PTM_RATIO, v.y * PTM_RATIO);
theta += k_increment;
}
glEnd();

}

void DebugDraw::DrawSolidCircle(const b2Vec2& center, float32 radius, const b2Vec2& axis, const b2Color& color)
{
const float32 k_segments = 16.0f;
const float32 k_increment = 2.0f * b2_pi / k_segments;
float32 theta = 0.0f;
glEnable(GL_BLEND);
glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glColor4f(0.5f * color.r, 0.5f * color.g, 0.5f * color.b, 0.5f);
glBegin(GL_TRIANGLE_FAN);
for (int32 i = 0; i < k_segments; ++i)
{
b2Vec2 v = center + radius * b2Vec2(cosf(theta), sinf(theta));
glVertex2f(v.x * PTM_RATIO, v.y * PTM_RATIO);
theta += k_increment;
}
glEnd();
glDisable(GL_BLEND);

theta = 0.0f;
glColor4f(color.r, color.g, color.b, 1.0f);
glBegin(GL_LINE_LOOP);
for (int32 i = 0; i < k_segments; ++i)
{
b2Vec2 v = center + radius * b2Vec2(cosf(theta), sinf(theta));
glVertex2f(v.x * PTM_RATIO, v.y * PTM_RATIO);
theta += k_increment;
}
glEnd();

b2Vec2 p = center + radius * axis;
glBegin(GL_LINES);
glVertex2f(center.x * PTM_RATIO, center.y * PTM_RATIO);
glVertex2f(p.x * PTM_RATIO, p.y * PTM_RATIO);
glEnd();

}

void DebugDraw::DrawSegment(const b2Vec2& p1, const b2Vec2& p2, const b2Color& color)
{
glColor3f(color.r, color.g, color.b);
glBegin(GL_LINES);
glVertex2f(p1.x * PTM_RATIO, p1.y * PTM_RATIO);
glVertex2f(p2.x * PTM_RATIO, p2.y * PTM_RATIO);
glEnd();
}

void DebugDraw::DrawTransform(const b2Transform& xf)
{

b2Vec2 p1 = xf.position, p2;
const float32 k_axisScale = 0.4f;
glBegin(GL_LINES);

glColor3f(1.0f, 0.0f, 0.0f);
glVertex2f(p1.x * PTM_RATIO, p1.y * PTM_RATIO);
p2 = p1 + k_axisScale * xf.R.col1;
glVertex2f(p2.x * PTM_RATIO, p2.y * PTM_RATIO);

glColor3f(0.0f, 1.0f, 0.0f);
glVertex2f(p1.x * PTM_RATIO, p1.y * PTM_RATIO);
p2 = p1 + k_axisScale * xf.R.col2;
glVertex2f(p2.x * PTM_RATIO, p2.y * PTM_RATIO);

glEnd();
}

void DebugDraw::DrawPoint(const b2Vec2& p, float32 size, const b2Color& color)
{
glPointSize(size);
glBegin(GL_POINTS);
glColor3f(color.r, color.g, color.b);
glVertex2f(p.x * PTM_RATIO, p.y * PTM_RATIO);
glEnd();
glPointSize(1.0f);
}

void DebugDraw::DrawString(int x, int y, const char *string, ...)
{
//char buffer[128];
//
// va_list arg;
// va_start(arg, string);
// vsprintf(buffer, string, arg);
// va_end(arg);
//
// glMatrixMode(GL_PROJECTION);
// glPushMatrix();
// glLoadIdentity();
// int w = glutGet(GLUT_WINDOW_WIDTH);
// int h = glutGet(GLUT_WINDOW_HEIGHT);
// gluOrtho2D(0, w, h, 0);
// glMatrixMode(GL_MODELVIEW);
// glPushMatrix();
// glLoadIdentity();
//
// glColor3f(0.9f, 0.6f, 0.6f);
// glRasterPos2i(x, y);
// int32 length = (int32)strlen(buffer);
// for (int32 i = 0; i < length; ++i)
// {
// glutBitmapCharacter(GLUT_BITMAP_8_BY_13, buffer[i]);
// }
//
// glPopMatrix();
// glMatrixMode(GL_PROJECTION);
// glPopMatrix();
// glMatrixMode(GL_MODELVIEW);
}

void DebugDraw::DrawAABB(b2AABB* aabb, const b2Color& c)
{
glColor3f(c.r, c.g, c.b);
glBegin(GL_LINE_LOOP);
glVertex2f(aabb->lowerBound.x * PTM_RATIO, aabb->lowerBound.y * PTM_RATIO);
glVertex2f(aabb->upperBound.x * PTM_RATIO, aabb->lowerBound.y * PTM_RATIO);
glVertex2f(aabb->upperBound.x * PTM_RATIO, aabb->upperBound.y * PTM_RATIO);
glVertex2f(aabb->lowerBound.x * PTM_RATIO, aabb->upperBound.y * PTM_RATIO);
glEnd();
}

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6286
  • Thor Developer
    • View Profile
    • Bromeon
SFML 2.0 with opengl
« Reply #1 on: March 12, 2011, 12:11:01 pm »
If you want to render with OpenGL in a SFML application, you have to use sf::RenderWindow's methods SaveGLStates() and RestoreGLStates().
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

excrulon

  • Newbie
  • *
  • Posts: 12
    • View Profile
SFML 2.0 with opengl
« Reply #2 on: April 10, 2011, 07:40:35 am »
Might I ask if you got this working? I'm trying to do the same thing, yet none of the opengl things are working. From the tutorials:

Quote
To use OpenGL, you only have to include Window.hpp : the OpenGL and GLU headers will be automatically included by it. This is to prevent you from having to use preprocessor, as OpenGL headers have different names on each operating system."


So I tried that, yet I still get a ton of errors saying things like:

Quote
1>DebugDraw.cpp(29): error C3861: 'glBegin': identifier not found


What am I doing wrong?

Code: [Select]
#ifndef DEBUG_DRAW_H
#define DEBUG_DRAW_H

#include <Box2D/Box2D.h>

#include <SFML/Window.hpp>

struct b2AABB;

// This class implements debug drawing callbacks that are invoked
// inside b2World::Step.
class DebugDraw : public b2DebugDraw
{
public:
void DrawPolygon(const b2Vec2* vertices, int32 vertexCount, const b2Color& color);

void DrawSolidPolygon(const b2Vec2* vertices, int32 vertexCount, const b2Color& color);

void DrawCircle(const b2Vec2& center, float32 radius, const b2Color& color);

void DrawSolidCircle(const b2Vec2& center, float32 radius, const b2Vec2& axis, const b2Color& color);

void DrawSegment(const b2Vec2& p1, const b2Vec2& p2, const b2Color& color);

void DrawTransform(const b2Transform& xf);

    void DrawPoint(const b2Vec2& p, float32 size, const b2Color& color);

    void DrawString(int x, int y, const char* string, ...);

    void DrawAABB(b2AABB* aabb, const b2Color& color);
};


#endif


Code: [Select]

/*
* Copyright (c) 2006-2007 Erin Catto http://www.gphysics.com
*
* This software is provided 'as-is', without any express or implied
* warranty.  In no event will the authors be held liable for any damages
* arising from the use of this software.
* Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it
* freely, subject to the following restrictions:
* 1. The origin of this software must not be misrepresented; you must not
* claim that you wrote the original software. If you use this software
* in a product, an acknowledgment in the product documentation would be
* appreciated but is not required.
* 2. Altered source versions must be plainly marked as such, and must not be
* misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution.
*/

#include "DebugDraw.h"

#include <cstdio>
#include <cstdarg>

#include <cstring>

void DebugDraw::DrawPolygon(const b2Vec2* vertices, int32 vertexCount, const b2Color& color)
{
glColor3f(color.r, color.g, color.b);
glBegin(GL_LINE_LOOP);
for (int32 i = 0; i < vertexCount; ++i)
{
glVertex2f(vertices[i].x, vertices[i].y);
}
glEnd();
}

void DebugDraw::DrawSolidPolygon(const b2Vec2* vertices, int32 vertexCount, const b2Color& color)
{
glEnable(GL_BLEND);
glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glColor4f(0.5f * color.r, 0.5f * color.g, 0.5f * color.b, 0.5f);
glBegin(GL_TRIANGLE_FAN);
for (int32 i = 0; i < vertexCount; ++i)
{
glVertex2f(vertices[i].x, vertices[i].y);
}
glEnd();
glDisable(GL_BLEND);

glColor4f(color.r, color.g, color.b, 1.0f);
glBegin(GL_LINE_LOOP);
for (int32 i = 0; i < vertexCount; ++i)
{
glVertex2f(vertices[i].x, vertices[i].y);
}
glEnd();
}

void DebugDraw::DrawCircle(const b2Vec2& center, float32 radius, const b2Color& color)
{
const float32 k_segments = 16.0f;
const float32 k_increment = 2.0f * b2_pi / k_segments;
float32 theta = 0.0f;
glColor3f(color.r, color.g, color.b);
glBegin(GL_LINE_LOOP);
for (int32 i = 0; i < k_segments; ++i)
{
b2Vec2 v = center + radius * b2Vec2(cosf(theta), sinf(theta));
glVertex2f(v.x, v.y);
theta += k_increment;
}
glEnd();
}

void DebugDraw::DrawSolidCircle(const b2Vec2& center, float32 radius, const b2Vec2& axis, const b2Color& color)
{
const float32 k_segments = 16.0f;
const float32 k_increment = 2.0f * b2_pi / k_segments;
float32 theta = 0.0f;
glEnable(GL_BLEND);
glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glColor4f(0.5f * color.r, 0.5f * color.g, 0.5f * color.b, 0.5f);
glBegin(GL_TRIANGLE_FAN);
for (int32 i = 0; i < k_segments; ++i)
{
b2Vec2 v = center + radius * b2Vec2(cosf(theta), sinf(theta));
glVertex2f(v.x, v.y);
theta += k_increment;
}
glEnd();
glDisable(GL_BLEND);

theta = 0.0f;
glColor4f(color.r, color.g, color.b, 1.0f);
glBegin(GL_LINE_LOOP);
for (int32 i = 0; i < k_segments; ++i)
{
b2Vec2 v = center + radius * b2Vec2(cosf(theta), sinf(theta));
glVertex2f(v.x, v.y);
theta += k_increment;
}
glEnd();

b2Vec2 p = center + radius * axis;
glBegin(GL_LINES);
glVertex2f(center.x, center.y);
glVertex2f(p.x, p.y);
glEnd();
}

void DebugDraw::DrawSegment(const b2Vec2& p1, const b2Vec2& p2, const b2Color& color)
{
glColor3f(color.r, color.g, color.b);
glBegin(GL_LINES);
glVertex2f(p1.x, p1.y);
glVertex2f(p2.x, p2.y);
glEnd();
}

void DebugDraw::DrawTransform(const b2Transform& xf)
{
b2Vec2 p1 = xf.position, p2;
const float32 k_axisScale = 0.4f;
glBegin(GL_LINES);

glColor3f(1.0f, 0.0f, 0.0f);
glVertex2f(p1.x, p1.y);
p2 = p1 + k_axisScale * xf.R.col1;
glVertex2f(p2.x, p2.y);

glColor3f(0.0f, 1.0f, 0.0f);
glVertex2f(p1.x, p1.y);
p2 = p1 + k_axisScale * xf.R.col2;
glVertex2f(p2.x, p2.y);

glEnd();
}

void DebugDraw::DrawPoint(const b2Vec2& p, float32 size, const b2Color& color)
{
glPointSize(size);
glBegin(GL_POINTS);
glColor3f(color.r, color.g, color.b);
glVertex2f(p.x, p.y);
glEnd();
glPointSize(1.0f);
}

void DebugDraw::DrawString(int x, int y, const char *string, ...)
{
char buffer[128];

va_list arg;
va_start(arg, string);
vsprintf(buffer, string, arg);
va_end(arg);

glMatrixMode(GL_PROJECTION);
glPushMatrix();
glLoadIdentity();
int w = glutGet(GLUT_WINDOW_WIDTH);
int h = glutGet(GLUT_WINDOW_HEIGHT);
gluOrtho2D(0, w, h, 0);
glMatrixMode(GL_MODELVIEW);
glPushMatrix();
glLoadIdentity();

glColor3f(0.9f, 0.6f, 0.6f);
glRasterPos2i(x, y);
int32 length = (int32)strlen(buffer);
for (int32 i = 0; i < length; ++i)
{
glutBitmapCharacter(GLUT_BITMAP_8_BY_13, buffer[i]);
}

glPopMatrix();
glMatrixMode(GL_PROJECTION);
glPopMatrix();
glMatrixMode(GL_MODELVIEW);
}

void DebugDraw::DrawAABB(b2AABB* aabb, const b2Color& c)
{
glColor3f(c.r, c.g, c.b);
glBegin(GL_LINE_LOOP);
glVertex2f(aabb->lowerBound.x, aabb->lowerBound.y);
glVertex2f(aabb->upperBound.x, aabb->lowerBound.y);
glVertex2f(aabb->upperBound.x, aabb->upperBound.y);
glVertex2f(aabb->lowerBound.x, aabb->upperBound.y);
glEnd();
}


Thanks.

edit: Alright, mostly fixed it. Found a post where Laurent said opengl is no longer included in Window, so I needed to include SFML/OpenGL.hpp.

Now I just need to find a solution to using
glutGet(GLUT_WINDOW_WIDTH);
and
glutBitmapCharacter(GLUT_BITMAP_8_BY_13, buffer);

since glut isn't a part of SFML... any ideas on what I can use instead? for now I'll just comment out drawstring like he did above since I won't need it for now.

Now I'm getting:

1>DebugDraw.obj : error LNK2019: unresolved external symbol __imp_glEnd referenced in function "public: virtual void __cdecl DebugDraw::DrawPolygon(struct b2Vec2 const *,int,struct b2Color const &)" (?DrawPolygon@DebugDraw@@UEAAXPEBUb2Vec2@@HAEBUb2Color@@@Z)
1>DebugDraw.obj : error LNK2019: unresolved external symbol __imp_glVertex2f referenced in function "public: virtual void __cdecl DebugDraw::DrawPolygon(struct b2Vec2 const *,int,struct b2Color const &)" (?DrawPolygon@DebugDraw@@UEAAXPEBUb2Vec2@@HAEBUb2Color@@@Z)
1>DebugDraw.obj : error LNK2019: unresolved external symbol __imp_glBegin referenced in function "public: virtual void __cdecl DebugDraw::DrawPolygon(struct b2Vec2 const *,int,struct b2Color const &)" (?DrawPolygon@DebugDraw@@UEAAXPEBUb2Vec2@@HAEBUb2Color@@@Z)
1>DebugDraw.obj : error LNK2019: unresolved external symbol __imp_glColor3f referenced in function "public: virtual void __cdecl DebugDraw::DrawPolygon(struct b2Vec2 const *,int,struct b2Color const &)" (?DrawPolygon@DebugDraw@@UEAAXPEBUb2Vec2@@HAEBUb2Color@@@Z)
1>DebugDraw.obj : error LNK2019: unresolved external symbol __imp_glDisable referenced in function "public: virtual void __cdecl DebugDraw::DrawSolidPolygon(struct b2Vec2 const *,int,struct b2Color const &)" (?DrawSolidPolygon@DebugDraw@@UEAAXPEBUb2Vec2@@HAEBUb2Color@@@Z)
1>DebugDraw.obj : error LNK2019: unresolved external symbol __imp_glColor4f referenced in function "public: virtual void __cdecl DebugDraw::DrawSolidPolygon(struct b2Vec2 const *,int,struct b2Color const &)" (?DrawSolidPolygon@DebugDraw@@UEAAXPEBUb2Vec2@@HAEBUb2Color@@@Z)
1>DebugDraw.obj : error LNK2019: unresolved external symbol __imp_glBlendFunc referenced in function "public: virtual void __cdecl DebugDraw::DrawSolidPolygon(struct b2Vec2 const *,int,struct b2Color const &)" (?DrawSolidPolygon@DebugDraw@@UEAAXPEBUb2Vec2@@HAEBUb2Color@@@Z)
1>DebugDraw.obj : error LNK2019: unresolved external symbol __imp_glEnable referenced in function "public: virtual void __cdecl DebugDraw::DrawSolidPolygon(struct b2Vec2 const *,int,struct b2Color const &)" (?DrawSolidPolygon@DebugDraw@@UEAAXPEBUb2Vec2@@HAEBUb2Color@@@Z)
1>DebugDraw.obj : error LNK2019: unresolved external symbol __imp_glPointSize referenced in function "public: void __cdecl DebugDraw::DrawPoint(struct b2Vec2 const &,float,struct b2Color const &)" (?DrawPoint@DebugDraw@@QEAAXAEBUb2Vec2@@MAEBUb2Color@@@Z)


Anyone know how to fix this?

another edit: fixed it by doing:
#pragma comment(lib, "opengl32.lib")

Seems like a messy way of fixing it... but it worked. Is that the best way?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
SFML 2.0 with opengl
« Reply #3 on: April 10, 2011, 09:27:57 am »
Quote
Seems like a messy way of fixing it... but it worked. Is that the best way?

Nop. Add opengl32.lib in the list of dependencies in your linker settings.

Quote
Now I just need to find a solution to using
glutGet(GLUT_WINDOW_WIDTH);
and
glutBitmapCharacter(GLUT_BITMAP_8_BY_13, buffer);

glutGet(GLUT_WINDOW_WIDTH) -> window.GetWidth() (I guess)
glutBitmapCharacter -> there's a text API in sfml-graphics
Laurent Gomila - SFML developer

vidjogamer

  • Jr. Member
  • **
  • Posts: 67
    • View Profile
SFML 2.0 with opengl
« Reply #4 on: May 04, 2011, 03:28:32 pm »
If I render between saving and restoring the GL state nothing appears on the screen.

Do I have to change the gl viewport or set a transform? How can I easily get to the transform before my call to save GL state?

Or perhaps its a blending issue?

Im just shooting in the dark here.


EDIT:  Without the call to save the state, it draws in the correct location and in the right colors but it messes up any fonts I have on the screen. They are not antialiased anymore...

vidjogamer

  • Jr. Member
  • **
  • Posts: 67
    • View Profile
SFML 2.0 with opengl
« Reply #5 on: May 04, 2011, 03:54:43 pm »
So I ended up just replacing it with an SFML implementation of DebugDraw and it works like a charm. I would like to know if anyone knows why the opengl implementation wasnt working though. I might choose to use some opengl in the near future.

vidjogamer

  • Jr. Member
  • **
  • Posts: 67
    • View Profile
SFML 2.0 with opengl
« Reply #6 on: May 04, 2011, 06:36:21 pm »
I started using Hiura's animation package and realized that it had similar problems, I ended up changing the implementation to use the sf::Renderer but theres one call I dont know how to do: glDisable(GL_TEXTURE_2D);

Can I call glDisable from the Renderer? How? I didnt realize it was advised to use a renderer for opengl drawing. When I found it practically all my problems were solved  :roll:

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
SFML 2.0 with opengl
« Reply #7 on: May 04, 2011, 07:31:42 pm »
Don't use it too much, it may be removed soon ;)

What you need is renderer.SetTexture(NULL).
Laurent Gomila - SFML developer

vidjogamer

  • Jr. Member
  • **
  • Posts: 67
    • View Profile
SFML 2.0 with opengl
« Reply #8 on: May 04, 2011, 08:12:55 pm »
Oh is that so? Taking a different approach?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
SFML 2.0 with opengl
« Reply #9 on: May 04, 2011, 10:08:15 pm »
Yep.
Laurent Gomila - SFML developer

vidjogamer

  • Jr. Member
  • **
  • Posts: 67
    • View Profile
SFML 2.0 with opengl
« Reply #10 on: May 05, 2011, 08:31:44 am »
Haha is it a secret? I wanted to know what it was =p

Anyway, if the Renderer isnt going to be the way to do things, I still need to figure out how to get the opengl calls working then. For example, Hiura's animation package does not work correctly. My test animation sprite turns the same color as my text that im rendering.

Code: [Select]

f.my_image->Bind();


// Calculate the texture coordinates
sf::FloatRect rect =
f.my_image->GetTexCoords(f.my_rect);

// Draw the animation's triangles
glBegin(GL_QUADS);
                glTexCoord2f(rect.Left,  rect.Top);
                glVertex2f(0,     0);

                glTexCoord2f(rect.Left,  rect.Height);
glVertex2f(0,     height);

                glTexCoord2f(rect.Width, rect.Height);
glVertex2f(width, height);

glTexCoord2f(rect.Width, rect.Top);
glVertex2f(width, 0) ;
glEnd();


Theres nothing fancy going on with the text. Its just an sf::Text being passed to my RenderWindow's Draw call.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
SFML 2.0 with opengl
« Reply #11 on: May 05, 2011, 08:56:47 am »
Quote
Haha is it a secret? I wanted to know what it was =p

It's still a secret because I don't know yet what I'll implement to replace it :lol:

Quote
Anyway, if the Renderer isnt going to be the way to do things, I still need to figure out how to get the opengl calls working then.

Until the renderer exists, you should use it inside drawables.
If you want to use OpenGL directly, you must use the SaveGLStates() and RestoreGLStates() functions (they are members of sf::RenderWindow).
Laurent Gomila - SFML developer