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

Author Topic: Embedding an OpenGL window in a Render Window  (Read 2683 times)

0 Members and 1 Guest are viewing this topic.

eawerbaneth

  • Newbie
  • *
  • Posts: 7
    • View Profile
Embedding an OpenGL window in a Render Window
« on: April 06, 2012, 02:06:15 am »
Hi,

I'm having a little trouble decoding how you are supposed to embed an OpenGL window inside another window. I didn't have any luck looking for an example, and what I'm trying right now crashes upon running.

Here's what I have:
sf::RenderWindow control_window(sf::VideoMode(800, 600), "Sculptor");

sf::Window openglwindow;
sf::WindowHandle handle = control_window.GetSystemHandle();
openglwindow.Create(handle);

 

Is this the correct way to do this? Also, how would I then specify a size for the OpenGL window?

Thanks in advance!

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Embedding an OpenGL window in a Render Window
« Reply #1 on: April 06, 2012, 09:31:45 am »
You can't embed a SFML window into another SFML window. Why do you want to do this?
Laurent Gomila - SFML developer

eawerbaneth

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Embedding an OpenGL window in a Render Window
« Reply #2 on: April 06, 2012, 05:02:23 pm »
I'm trying to make my own SFML GUI for an OpenGL project that I'm also using SFML to display. I read something about being able to display 2-D SFML graphics over an OpenGL window and that I could find this in the "OpenGL sample project", but I haven't been able to find any links to that. What is the correct way of doing this?

* I'm using SFML 2.0, by the way.
« Last Edit: April 06, 2012, 05:07:02 pm by eawerbaneth »

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Embedding an OpenGL window in a Render Window
« Reply #3 on: April 06, 2012, 05:06:58 pm »
You don't have to create another physical window, you can mix SFML and OpenGL in the same window.

You can find the OpenGL example in the SFML SDK.
Laurent Gomila - SFML developer

eawerbaneth

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Embedding an OpenGL window in a Render Window
« Reply #4 on: April 06, 2012, 08:53:52 pm »
Will do. Thanks for your help!

 

anything