Does the current version of SDL allow for full window transparency? - sdl

Is it possible to use SDL to create a window with a transparent "hole" in it, i.e. with whatever application is beneath the SDL-driven application showing through? My understanding is that previous versions of SDL did not support this, so I'm hoping the latest version does.

If you are talking about SDL 1.2 then no , sdl 1.3 might have somthing like SDL_SetWindowShape
but I would say you would like that

Related

Creating OpenGl Window with c++ in windows using 64 bit + Custom Window Shape (etc smooth corners not rectangular)

Im trying to make a software in c++ using OpenGl & C++ it must be 64 bit and be able to have custom window (frame/"handler") etc no normal windows rectangle around it... and use an opacity on etc corners... so get rounded corners on the window/frame.. Anyone know what libs and how to do this? I know OpenGl & C++ however im not sure how to get the window & 64 bit.. since i tried glut but it fails on the 64 bit version and also do not feature the custom framing that i want... Any advice appreciated (: (I want to not use any extra libs) so creating a opengl context myself and import the opengl32.dll and functions from "windows" rather then using libs like etc glut :3 )
Maybe you want to take a closer look to the winapi (MS Windows only).
The procedure of creating a window is pretty straight forward and "binding" OpenGL to it is not that difficult. There is even a nice tutorial from the khronos-group:
OpenGL Winapi Setup Tutorial
Thats the first step, creating round edges is another.
There are tons of approaches to achieve the desired effect, I assume you want to make your window frame as rounded in the default window 7 scheme.
Enabling Visual Styles
If that is not what you want, you can create a frame by yourself by opening a frameless window with winapi and draw your frame with OpenGL.

OpenVR. Rendering in OpenGL without SDL

Is this possible in nature? What role of SDL library in OpenVR API? Does it needed for OpenGL context or only for mirroring the stereo image to SDL window?
It is possible. If you don't use SDL, you'll have to create your rendering context and window by yourself. The whole code would be too long for this answer, but on Windows you could use functions like CreateWindowEx and wglCreateContext. OpenVR doesn't require anything different from a normal context setup, but you need to use a somewhat modern version of OpenGL (4.1 at least works for me).

Using SDL, OpenGL and Qt together

For a while I've been using SDL to write my 3D engine,and have recently been implementing an editor that can export an optimized format for the type of engine Im building. Right now the editor is fairly simple, objects can just be moved around and their textures and models can be changed. As of right now, I'm using SDL with OpenGL to render everything, but I want to use Qt for the GUI part of the editor, that way it looks native on every platform. I've got it working great so far, I'm running a QApplication inside of the SDL application, so it basically just opens 2 windows, one that uses SDL and OpenGL, and the other using Qt. Doing a bit of research, I've found that you can manually update a QApplication, which totally removes any threading problems, and everything works. Just in case you're having a hard time visualizing this, heres a picture:
What my goal is to merge these windows into one, because on smaller screens (like my laptop's) it makes it really hard to keep track of all the different windows that I would eventually have. I know theres a way to render to Qt with OpenGL, but can this be integrated with SDL? Am I going to need to move away from using an SDL window and use a QT one if the editor is enabled? Just to clarify, when the engine isn't in editor mode, it won't use and Qt, just SDL, so optimally I wouldn't need to do this.
Drop the SDL part. You have Qt, which does everything SDL does as well. Just subclass a QGLWidget and use that.
You can keep your game and editor separate processes and still make them part of the same app.
Just spawn the window where you want the game to run as part of Qt, and at least in windows, you can then pass the window handle to your game, and make sure when your game is setting up, instead of creating the window yourself in SDL and binding the opengl context to it, you can actually bind to the existing handle.
There are some gotchas with this technique to watch out for such as input focus I believe (I tested with directX, but it might be similar with SDL). The problem is that the foreground mode does some dumb checks on the "root" window which for me was not the window that owned the opengl context, so it failed to initialize. However background mode worked. I think that was for a joystick now that I think about it, but anyway, that's how you can merge everything together.

How to create a fullscreen OpenGL-ES renderview in Windows?

I'm using cocos2d-x to develop an iPhone game and then it just came to my head why not release my game for PC too? The only problem is that setting the window to full screen mode is not implemented yet. Now I'm just stuck with how to create a full screen window? There are some window creation functions that are used but I'm not sure which one and how I should change.
There is the eglCreateWindowSurface function that cocos2d is calling to create a window. I'm not sure which option I should change so that it creates a full screen window. It would also be nice if I can implement a function that switches my game to full screen mode and back while running.
On Windows it's a bit more compilicated. Essentially you have to:
Create a proxy OpenGL context to get access to functionality above OpenGL-1.1 through extensions
Load the extensions required to create an OpenGL-ES compatible context
Create the higher version OpenGL context
Again Load the extensions, now for this context
Luckily all this has been wrapped up in several easy to use libraries. I recomment GLFW for Window/Context creation (it deals with all that proxy context stuff, too), and GLee or GLEW to make the OpenGL extensions available to the code.
http://www.glfw.org/
http://elf-stone.com/glee.php
http://glew.sourceforge.net/
Those libraries are cross platform, so your application/game itself does not use OS dependent functions, it will compile not only for Windows but also Linux, BSD and MacOS X.

How to create OpenGL-enabled window with transparent background using xlib and glx

I'd like to create a window with transparent background and then render something onto it using OpenGL. I don't want to use the trick where whatever is behind the window is captured and then painted as a background - I want real transparency (I have composition manager running). I'm not using any GUI library (GTK, QT, ...), just raw xlib and glx.
Anyone knows how to do it?
Take a look at these patches to Neverball and SDL. They seem to be based on NVidia's driver documentation.
I haven't tried it, but it looks as if you just select the correct GLX config (GLX_RGBA_BIT), clear your window appropriately, and have a compositor running, it should Just Work™.