Render to an OpenGL context
Render to an OpenGL context
Could someone please show me a helloworld type irrlicht example where irrlicht only knows of and renders to an OpenGL context that is given to it? I would like to use irrlicht as a pure graphics library, and use another library for keyboard input, etc. I would like to use SDL or Allegro for the non-graphics related stuff, and as I understand it, irrlicht was originally meant to be graphics only anyway. Thanks.
-
- Admin
- Posts: 14143
- Joined: Wed Apr 19, 2006 9:20 pm
- Location: Oldenburg(Oldb), Germany
- Contact:
Re: Render to an OpenGL context
So you don't want to use SDL to create the window anymore. I guess your post in beginner's forum is obsolete then?
I think the easiest way is to use the SDL device for everything. This allows to create the render window by SDL as well, and render into it with Irrlicht. I/O is then automatically used based on SDL.
I think the easiest way is to use the SDL device for everything. This allows to create the render window by SDL as well, and render into it with Irrlicht. I/O is then automatically used based on SDL.
Re: Render to an OpenGL context
I was thinking there would be a function that I was just not noticing, which could take opengl data. I wasn't planning on using SDL for this problem, but if I had a working SDL+irrlicht project, I guess that might also lead to solving my problem here if in a much different way.
What is the difference between Context, Display, and Window? As in (SExposedVideoData.h):
And is there any good resources where these three X11 datastuctures are explained?
PS. Actually, this is a different problem than the beginner thread I'm trying to figure out than the other one which was specifically about SDL and a specific platform. I posted that there since it was about setup, rather than programming. But since that was closed, I would be interested in posts related to the other question here. I've seen a couple of people trying to figure this out though, so I don't expect a lot. On that note, what is the opinion of reviving dead threads - I see some that are similar that haven't been answered for years, and others that are a couple months old? I ask since many forums don't like reviving stuff more than 30 days, but if its different here I can do that if that is the preferred way rather than creating new threads.
What is the difference between Context, Display, and Window? As in (SExposedVideoData.h):
Code: Select all
struct
00076 {
00077 // XWindow handles
00078 void* X11Display;
00079 void* X11Context;
00080 unsigned long X11Window;
00081 } OpenGLLinux;
PS. Actually, this is a different problem than the beginner thread I'm trying to figure out than the other one which was specifically about SDL and a specific platform. I posted that there since it was about setup, rather than programming. But since that was closed, I would be interested in posts related to the other question here. I've seen a couple of people trying to figure this out though, so I don't expect a lot. On that note, what is the opinion of reviving dead threads - I see some that are similar that haven't been answered for years, and others that are a couple months old? I ask since many forums don't like reviving stuff more than 30 days, but if its different here I can do that if that is the preferred way rather than creating new threads.
Re: Render to an OpenGL context
Surely this is a similar question to "How can I get Irrlicht to render into a Qt window"? For this question there is an answer in the forums.
-
- Admin
- Posts: 14143
- Joined: Wed Apr 19, 2006 9:20 pm
- Location: Oldenburg(Oldb), Germany
- Contact:
Re: Render to an OpenGL context
Reviving old threads is often unnecessary for posting the same unanswered question again. If you have an answer, it is ok to revive them. Otherwise start a new thread if the others are at least several months old.
There's not much difference between asking for rendering to an external OGL context by using SDL, and setting up an SDL based Irrlicht rendering. So you should keep these things in one thread until you find a clearly differentiating point and need to split into two discussion threads.
For an SDL based device you simply enable this in IrrCompileConfig, recompile Irrlicht, recompile your app (using the SDL device) and link your app against SDL library. If everything goes well, you can use SDL I/O (also via Irrlicht I/O functions, or native), and you can render with Irrlicht and SDL to the window.
There's not much difference between asking for rendering to an external OGL context by using SDL, and setting up an SDL based Irrlicht rendering. So you should keep these things in one thread until you find a clearly differentiating point and need to split into two discussion threads.
For an SDL based device you simply enable this in IrrCompileConfig, recompile Irrlicht, recompile your app (using the SDL device) and link your app against SDL library. If everything goes well, you can use SDL I/O (also via Irrlicht I/O functions, or native), and you can render with Irrlicht and SDL to the window.