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 - newobj

Pages: [1]
1
Graphics / Re: ContextSettings interfering with sprite
« on: September 14, 2017, 08:10:25 pm »
Oh, I see. I'm on OSX. So I can only have Legacy or Core context. But SFML Graphics module doesn't work if I pick Core context. So I'm confused.

On OSX I can only have Legacy OpenGL 2.1 then if I want to also use SFML Graphics??

2
Graphics / ContextSettings interfering with sprite
« on: September 14, 2017, 07:29:32 pm »
Hi.

I'm trying to use Nuklear with SFML (see https://github.com/vurtun/nuklear/blob/master/demo/sfml_opengl3/main.cpp). Nuklear requires a particular specification of ContexSettings:

sf::ContextSettings settings(24, 8, 4, 3, 3);
 

However, when this ContexSettings is used, it causes sprites to not render. I've isolated the issue to the following sample code:

#include <SFML/Graphics.hpp>
int main() {
    sf::ContextSettings settings(24, 8, 4, 3, 3);
    sf::RenderWindow window(sf::VideoMode(800, 600), "Demo", sf::Style::Default, settings);
    sf::Texture texture;
    if (!texture.loadFromFile("res/tex/logo.png")) exit(-1);
    sf::Sprite sprite(texture);
    while (window.isOpen())
    {
        sf::Event event;
        while (window.pollEvent(event))
        {
            if (event.type == sf::Event::Closed) window.close();
        }
        window.clear(sf::Color::Black);
        window.draw(sprite);
        window.display();
    }
    return 0;
}
 

if I ignore the ContexSettings, e.g.

sf::RenderWindow window(sf::VideoMode(800, 600), "Demo", sf::Style::Default/*, settings*/);
 

then my sprite renders fine (but nuklear doesn't work).

What exactly is it about those ContextSettings that causes my sprite to not render?

Thanks!

Pages: [1]
anything