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

Author Topic: Problem with drawing OpenGL 3.0+ in SFML window  (Read 12456 times)

0 Members and 1 Guest are viewing this topic.

binary1248

  • SFML Team
  • Hero Member
  • *****
  • Posts: 1405
  • I am awesome.
    • View Profile
    • The server that really shouldn't be running
Re: Problem with drawing OpenGL 3.0+ in SFML window
« Reply #15 on: January 15, 2015, 11:23:48 pm »
Linux OpenGL development only gets annoying when you are using the "free" drivers. If you are using the vendor drivers, I find it can be easier to develop on Linux than on Windows sometimes. In this case, you aren't using Mesa (the free driver) so compatibility contexts should work, and so should SFML 2.2 but only if you run it on the discrete GPU as you found out. When using SFML, it is always recommended to run it using discrete GPUs, there have been many issues with IGPs in the past but slowly they are being fixed.
SFGUI # SFNUL # GLS # Wyrm <- Why do I waste my time on such a useless project? Because I am awesome (first meaning).

Haize

  • Newbie
  • *
  • Posts: 15
    • View Profile
Re: Problem with drawing OpenGL 3.0+ in SFML window
« Reply #16 on: January 16, 2015, 11:58:49 am »
Thought I should add that after my success with using bumblebee I attempted to use the Graphics Module again.

Guess what it worked  ;D.

So no I have all the functionality of SFML which is amazing!  8)

I also removed GLU from linking. In the SFML OpenGL tutorial it mentions you may need to link it but seems to work without it.

binary1248

  • SFML Team
  • Hero Member
  • *****
  • Posts: 1405
  • I am awesome.
    • View Profile
    • The server that really shouldn't be running
Re: Problem with drawing OpenGL 3.0+ in SFML window
« Reply #17 on: January 16, 2015, 04:08:59 pm »
I also removed GLU from linking. In the SFML OpenGL tutorial it mentions you may need to link it but seems to work without it.
Good... because it (GLU support) will probably get removed sometime soon ;).
SFGUI # SFNUL # GLS # Wyrm <- Why do I waste my time on such a useless project? Because I am awesome (first meaning).

Haize

  • Newbie
  • *
  • Posts: 15
    • View Profile
Re: Problem with drawing OpenGL 3.0+ in SFML window
« Reply #18 on: January 17, 2015, 06:14:17 pm »
EDIT: For other poor souls like me with an Nvidia Optimus card please look into using the bumblebee graphics package as from my experience it is by far the most stable. You do have the inconvenience of needing to set which programs use your Nvidia card and which do not, but this is minor in comparison to your desktop freezing every 5 minutes (in my experience anyway). 

Seems I was wrong again. I found that after closer inspection the bumblebee drivers were causing errors with X Server. I decided to give the Nvidia drivers a go again and found this solved the errors with the scene rendered as expected and no need for manually executing a program with the command:
optirun

I followed these steps:

*NOTE* Make sure you have the nouveau driver installed so you can use it after purging Nvidia drivers.

1. First select the nouveau driver from Software Settings -> Software and Updates -> Additional Drivers.
Now purge all Nvidia and bumblebee driver/packages:
sudo apt-get purge bumblebee*
sudo apt-get pruge nvidia-*

2. Reboot

3. After reboot reinstall the nvidia-331,  nvidia-prime and  nvidia-settings drivers/packages.

On Ubuntu 14.04 you can do this easily using the top right menu. Navigate to "Software Settings" -> "Software and Updates" -> "Additional Drivers" and select Nvidia 331-113. This will install the listed packages. Other distros can just use repositories I guess.

4. Reboot Again.

5. After reboot you should be able to run the command:
nvidia-settings


This will bring up the settings for you Nvidia GPU, you may need to change the performance settings under "PRIME profiles" and here you set the GPU. This may take logging in and out to take effect.

6. From here everything should work fine, well it is for me so far...  :-\

I found this guide useful:
https://afterhourscoding.wordpress.com/2014/04/30/dell-l502x-optimus-support-on-ubuntu-14-04/

Haize