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

Author Topic: SFML OpenGL implementation  (Read 5537 times)

0 Members and 1 Guest are viewing this topic.

znyk

  • Newbie
  • *
  • Posts: 10
    • View Profile
SFML OpenGL implementation
« on: February 21, 2018, 04:05:04 pm »
I successful build this SFMLexample:
#include <SFML/Graphics.hpp>

int main()
{
    sf::RenderWindow window(sf::VideoMode(200, 200), "SFML works!");
    sf::CircleShape shape(100.f);
    shape.setFillColor(sf::Color::Green);

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

        window.clear();
        window.draw(shape);
        window.display();
    }

    return 0;
}

But when I run application It opens 2 windows:
-> First with information:


Warning: Detected "Microsoft Corporation GDI Generic" OpenGL implementation
The current OpenGL implementation is not hardware-accelerated
Setting vertical sync not supported

-> Second with main programme.

My question is how to switch off first window ?
Is somthing wrong with my graphics card driver ?
I have got ATI Radeon HD 3870 graphics card and driver date is 31.01.2018
« Last Edit: February 21, 2018, 04:37:54 pm by znyk »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
Re: SFML OpenGL implementation
« Reply #1 on: February 21, 2018, 06:57:05 pm »
If you see that message it means it's not running on your dedicated GPU. Not sure why, but maybe there's some option for your GPU to force some application to run with your GPU.

To remove the console window, check the FAQ: https://www.sfml-dev.org/faq.php#tr-win-console

Make sure to use the Help subforum next time.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

znyk

  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: SFML OpenGL implementation
« Reply #2 on: February 21, 2018, 07:45:47 pm »
I know my English isn't perfect but I think i understand everything.

I use Codeblocks. I change setting Console application to GUI application and replace int main with:
int WINAPI WinMain(HINSTANCE hThisInstance, HINSTANCE hPrevInstance, LPSTR lpszArgument, int nCmdShow

So do the step linking libsfml-main.a

But the programme don't run.
error: expected initializer before 'WinMain'
 int WINAPI WinMain(HINSTANCE hThisInstance, HINSTANCE hPrevInstance, LPSTR lpszArgument, int nCmdShow)

Quote
maybe there's some option for your GPU to force some application to run with your GPU.

Where can I find this option ? My workstation is Windows 10.
« Last Edit: February 21, 2018, 07:51:24 pm by znyk »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
Re: SFML OpenGL implementation
« Reply #3 on: February 21, 2018, 10:13:53 pm »
Seems like you didn't understand "alternatively". It means either do one or the other, but don't do both.
Either link sfml-main or define WinMain (not really recommended).

Check your AMD settings.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

znyk

  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: SFML OpenGL implementation
« Reply #4 on: February 22, 2018, 09:27:19 am »
I enter link sfml-main:

#include <SFML/Main.hpp>
but have the same error.

znyk

  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: SFML OpenGL implementation
« Reply #5 on: February 23, 2018, 09:10:56 am »
I solved this problem :) In  project -> propeties -> build targets I choose GUI application for debug and release and it works fine!!!