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

Pages: [1]
1
Window / Re: Change style of sf::RenderWindow.
« on: October 28, 2016, 08:35:55 pm »
Oh, silly me! Thank you very much!

2
Window / Re: Change style of sf::RenderWindow.
« on: October 28, 2016, 08:30:39 pm »
I'm sorry, I'm new to this but how would I go about that? Is there a function for closing and reopening a window?

3
Window / Change style of sf::RenderWindow.
« on: October 28, 2016, 08:21:49 pm »
I'm sorry but I'm not the best programmer and I'm kinda new to C++ but I was wondering if there is any way for me to change the style of a sf::RenderWindow from windowed to fullscreen. I saw a post on a way to fix it using some bodge but it only worked on Windows and I'm running Linux! Thanks in advance. Bye!

4
General / Re: SFML errors when compiling if OpenGL.hpp is included.
« on: September 11, 2016, 10:30:08 pm »
I've managed to link OpenGL but it's still throwing errors! I've compiled SFML myself and I had to disable SFML_OPENGL_ES does that matter? Whenever I compile with that enabled it throws:

fatal error: EGL/egl.h: No such file or directory

Do you know how to fix that?

5
General / Re: SFML errors when compiling if OpenGL.hpp is included.
« on: September 11, 2016, 03:35:52 pm »
How? Sorry I'm pretty new to this.

6
General / Re: SFML errors when compiling if OpenGL.hpp is included.
« on: September 11, 2016, 02:22:01 pm »
I managed to get it compiling but when I compile this code:

#include <SFML/Window.hpp>
#include <SFML/OpenGL.hpp>

int main()
{
    sf::Window window(sf::VideoMode(800, 600), "OpenGL", sf::Style::Default, sf::ContextSettings(32));
    window.setVerticalSyncEnabled(true);
   
    bool running = true;
    while (running)
    {
        sf::Event event;
        while (window.pollEvent(event))
        {
            if (event.type == sf::Event::Closed)
                running = false;
            else if (event.type == sf::Event::Resized)
                glViewport(0, 0, event.size.width, event.size.height);
        }

        glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

        window.display();
    }
   
    return 0;
}

It throws this error:

C:/path/to/my/project/src/main.cpp:28: undefined reference to `__imp_glViewport'
C:/path/to/my/project/src/main.cpp:33: undefined reference to `__imp_glClear'

7
General / Re: SFML errors when compiling if OpenGL.hpp is included.
« on: September 11, 2016, 01:39:46 pm »
I just tried that and I moved the GL folder to my MinGW include folder but it now errors with:

fatal error: winapifamily.h: No such file or directory

I tried moving that over but it just keeps throwing errors!

8
General / SFML errors when compiling if OpenGL.hpp is included.
« on: September 10, 2016, 07:42:20 pm »
Hello! I've been having this error for a couple days and I can't find a way to fix it. If I include SFML/OpenGL.hpp during the build it says this:

c:\mingw\include\sfml\opengl.hpp:46:23: fatal error: GL/gl.h: No such file or directory

I'm using MinGW on windows, my IDE is CLion and CLion uses CMake.

Here's the full error log:

Scanning dependencies of target LearningOpenGL
[ 50%] Building CXX object CMakeFiles/LearningOpenGL.dir/src/main.cpp.obj
In file included from C:\My\folder\path\src\main.cpp:4:0:
c:\mingw\include\sfml\opengl.hpp:46:23: fatal error: GL/gl.h: No such file or directory
compilation terminated.
mingw32-make.exe[3]: *** [CMakeFiles/LearningOpenGL.dir/src/main.cpp.obj] Error 1
mingw32-make.exe[2]: *** [CMakeFiles/LearningOpenGL.dir/all] Error 2
CMakeFiles\LearningOpenGL.dir\build.make:62: recipe for target 'CMakeFiles/LearningOpenGL.dir/src/main.cpp.obj' failed
CMakeFiles\Makefile2:66: recipe for target 'CMakeFiles/LearningOpenGL.dir/all' failed
CMakeFiles\Makefile2:78: recipe for target 'CMakeFiles/LearningOpenGL.dir/rule' failed
mingw32-make.exe[1]: *** [CMakeFiles/LearningOpenGL.dir/rule] Error 2
mingw32-make.exe: *** [LearningOpenGL] Error 2
Makefile:117: recipe for target 'LearningOpenGL' failed

And here's my code:

#include <SFML/System.hpp>
#include <SFML/Window.hpp>
#include <SFML/Graphics.hpp>
#include <SFML/OpenGL.hpp>

int main()
{
    sf::Window window(sf::VideoMode(800, 600), "OpenGL", sf::Style::Default, sf::ContextSettings(32));

    while (window.isOpen())
    {
        sf::Event event;

        while (window.pollEvent(event))
        {
            if (event.type == sf::Event::Closed)
                window.close();
        }
    }

    return 0;
}

P.S. It works fine when SFML/OpenGL.hpp isn't included.

Pages: [1]
anything