irrlicht + sdl on linux

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
a4z
Posts: 4
Joined: Wed Feb 07, 2007 12:47 pm

irrlicht + sdl on linux

Post by a4z »

I get 2 windows with this code, the SDL window and irrlicht window

Code: Select all

 	SDL_Init(SDL_INIT_VIDEO );
    SDL_Surface * sdldisplay = SDL_SetVideoMode(800,600,16,SDL_OPENGL); 
        
    SDL_SysWMinfo sdlinfo; 
    SDL_VERSION(&sdlinfo.version); 
    SDL_GetWMInfo(&sdlinfo); 
    SIrrlichtCreationParameters irrparas = SIrrlichtCreationParameters (); 
    
    irrparas.Bits=16; 
    irrparas.Fullscreen=false; 
    irrparas.WindowSize=dimension2d<s32>(800,600); 
    irrparas.DriverType=EDT_OPENGL; 
    irrparas.WindowId = sdlinfo.info.x11.window; 
    
    IrrlichtDevice *device = createDeviceEx(irrparas); 

after reading the api doc i thought that this code should work

after readin irr src code, i think on linux using a SDL window for irrlicht is impossible, is that right?
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Yes, there are some patches, but not a clean solution how to handle the full Linux display name. Usually you have several structures to use, e.g. screen, window, ... This does not fit into the existing structure, so mandrav casted a string into the int and parsed it later on. The latest version simply passes several values to the createDevice function, but I'm not sure if that will work for all situations - say multiple desktops, xinerama, ...
a4z
Posts: 4
Joined: Wed Feb 07, 2007 12:47 pm

Post by a4z »

bad news
I thought I have found a usefull gfx engine for my app
(i have an existing app using sdl and i just want to change the display (2d) stuff, leaf input and event handling untouched)
also the idea for an other app, where i would have to draw into a qt gl window, has died now

mandrav, patch ?
more info available?
i know the hardware where my app will run, maybe the patches are good enough for my need


is there mor stuff in irrlicht where api doc says that somethink works, and i just works on windows?

thanks for help
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

You can find the patch on my webpage. The second solution is found in the FAQ forum (or maybe even on the SF patch tracker).
I don't know if things only work on one platform. Usually all features are available on all platforms. But that's never for sure. E.g. FSAA does not work for OpenGL under Windows, but for all other hardware accelerated drivers on all platforms (Hmm, not sure for mac :wink: )
a4z
Posts: 4
Joined: Wed Feb 07, 2007 12:47 pm

Post by a4z »

I have to reaktivate this old thread because I saw that in the newest version of irrlicht there is the option to run irrlicht based on SDL

to get it running on my linux pc I had to do a few steps

in makefile (irrlicht/source)
CPPFLAGS = $(CXXINCS) -DIRRLICHT_EXPORTS=1 -D_IRR_USE_SDL_DEVICE_

in COpenGLExtensionHandler.h

line 37, I added
#include <SDL/SDL_video.h>
(for SDL_GL_GetProcAddress )

for compiling the samples I added
-I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT
to CPPFLAGS
and
-L/usr/lib -lSDL
to LDFLAGS
in the sample makefiles


thats all.
great

if it is not to complicated (and I can find som time to do it) I will try to enable irrlicht starting in a SDL window which I initialised myself.
maybe then I can mix ( and in future replace) my existing opengl grafics with new 3d stuff using irrlicht (which should bring better results:-)
(the app is not a game, but the user interface must be very eye candy)
netpipe
Posts: 669
Joined: Fri Jun 06, 2008 12:50 pm
Location: Edmonton, Alberta, Canada
Contact:

Re: irrlicht + sdl on linux

Post by netpipe »

anything new about this ?
Live long and phosphor!
-- https://github.com/netpipe/Luna Game Engine Status 95%
CuteAlien
Admin
Posts: 9645
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: irrlicht + sdl on linux

Post by CuteAlien »

Uhm, no idea :-( I only used Irrlicht+SDL once (with webgl). The main problem right now is that I haven't added an SDL2 port yet because I had planned to merge OGL-ES first (which then turned out not be not so easy). Which is missing most right now as SDL1 is hardly supported anymore.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Post Reply