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

Pages: [1]
1
General discussions / Re: SFML Render error
« on: October 01, 2020, 08:33:36 pm »
i know that qt can create OpenGL context, but i try in other project without qt and i also tried using window.setActive(true); result the same :-\

2
General discussions / Re: SFML Render error
« on: October 01, 2020, 04:55:16 pm »
Sorry, i wrote this code at night and but I tested it in 2018.
I make video with this problem
I haven't touched this code since 2018 and this problem still exists. ;)

3
General discussions / Re: SFML Render error
« on: October 01, 2020, 02:08:19 pm »
I'm using latest version SFML 2.5.1.


4
General discussions / SFML Render error
« on: October 01, 2020, 04:16:08 am »

I started learning SFML in 2018 and when i learn sfml, i noticed this.
if you declare sf::RenderWindow in the library and try to pass a pointer sf::Drawable or reference you get this error.


regardless of static or dynamic linking.


debug log
Code: [Select]
An internal OpenGL call failed in RenderTarget.cpp(301).
Expression:
 glVertexPointer(2, GL_FLOAT, sizeof(Vertex), data + 0)
Error description:
 GL_INVALID_OPERATION
 The specified operation is not allowed in the current state.


An internal OpenGL call failed in RenderTarget.cpp(302).
Expression:
 glColorPointer(4, GL_UNSIGNED_BYTE, sizeof(Vertex), data +
Error description:
 GL_INVALID_OPERATION
 The specified operation is not allowed in the current state.


An internal OpenGL call failed in RenderTarget.cpp(711).
Expression:
 glDrawArrays(mode, static_cast<GLint>(firstVertex), static_cast<GLsizei>(vertexCount))
Error description:
 GL_INVALID_OPERATION
 The specified operation is not allowed in the current state.


An internal OpenGL call failed in Texture.cpp(782).
Expression:
 glBindTexture(GL_TEXTURE_2D, 0)
Error description:
 GL_INVALID_OPERATION
 The specified operation is not allowed in the current state.


An internal OpenGL call failed in Texture.cpp(785).
Expression:
 glMatrixMode(GL_TEXTURE)
Error description:
 GL_INVALID_OPERATION
 The specified operation is not allowed in the current state.


An internal OpenGL call failed in Texture.cpp(786).
Expression:
 glLoadIdentity()
Error description:
 GL_INVALID_OPERATION
 The specified operation is not allowed in the current state.


An internal OpenGL call failed in Texture.cpp(789).
Expression:
 glMatrixMode(GL_MODELVIEW)
Error description:
 GL_INVALID_OPERATION
 The specified operation is not allowed in the current state.


An internal OpenGL call failed in RenderTarget.cpp(152).
Expression:
 glClearColor(color.r / 255.f, color.g / 255.f, color.b / 255.f, color.a / 255.f)
Error description:
 GL_INVALID_OPERATION
 The specified operation is not allowed in the current state.


An internal OpenGL call failed in RenderTarget.cpp(153).
Expression:
 glClear(GL_COLOR_BUFFER_BIT)
Error description:
 GL_INVALID_OPERATION
 The specified operation is not allowed in the current state.


An internal OpenGL call failed in RenderTextureImplFBO.cpp(208).
Expression:
 GLEXT_glBindFramebuffer(GLEXT_GL_FRAMEBUFFER, 0)
Error description:
 GL_INVALID_OPERATION
 The specified operation is not allowed in the current state.


testSF.dll

class TestSF
{
    sf::RenderWindow window
public:
    TestSF();


    sf::RenderWindow* getWindow();
    void draw(sf::Drawable *drawable);
}


TestSF()
    : window(sf::VideoMode(600,400), "Test")
{


}


sf::RenderWindow* TestSF::getWindow()
{
    return &window;
}


void TestSF::draw(sf::Drawable *drawable)
{
    sf::Event event;
    while (window.pollEvent(event))
    {
         if (event.type == sf::Event::Closed)
             window.close();
    }
    window.clear();
    window.draw(*drawable);
    window.display();
}
 

test.exe
#include <SFML/Graphics.hpp>
#include <testsf.hpp>

int main(void)
{
    TestSF test; // ok
    sf::RenderWindow *window = test.getWindow(); // ok
   
    sf::CircleShape shape(100.f); // ok
    shape.setFillColor(sf::Color::Green); //ok
   
    while (window->isOpen()) // ok
    {
        test.draw(shape); // error here
    }
}
 

but if i add sf::Context in main function the error disappears.

test.exe
#include <SFML/Graphics.hpp>
#include <testsf.hpp>

int main(void)
{
    sf::ContextSettings settings;
    sf::Context ctx(settings, 600, 400);
    TestSF test; // ok
    sf::RenderWindow *window = test.getWindow(); // ok
   
    sf::CircleShape shape(100.f); // ok
    shape.setFillColor(sf::Color::Green); //ok
   
    while (window->isOpen()) // ok
    {
        test.draw(shape); // ok
    }
}
 

Pages: [1]