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.


Topics - distagon140

Pages: [1]
1
Window / Conflict OpenGL - SFML?
« on: November 24, 2019, 05:08:07 pm »
Hello
I've a question about the following code:

void CScreen2::Update (float timestep) const {
    glClearColor (0.1, 0.2, 0.4, 1.0);
    sf::RenderWindow *window = app.winctrl.GetWin ();  // get a pointer to the instance of RenderWindow
    window->clear (sf::Color (25, 50, 100, 255));
//      glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
    DrawTexture (texid, 100, 100, 1, OR_BOTTOM);    // drawn in classic opengl manner
    window->display();
}
 

Update() is a callback, called in every frame. In this function I've to draw a lot of things with OpenGL, not with SFML graphics. The texture is only a test object. The code above doesn't work, it shows the empty background, not the texture. But when I change the window->clear() call with glClear() then all seems to be ok. Same when I add the line with glClear().
Could anyone explain this effect?

Pages: [1]
anything