Comments (2)
Is this something you're doing in XNA or is this something you're trying to do with a new FNA project?
XNA supported extra windows in a way, but a lot of it dealt with the user allocating their own Win32 HWND and stapling it to functions where it was needed. We can do this as well, but with SDL_Window* pointers.
For the mouse, this will be fixed in SDL 2.0.4 where we'll have access to SDL_GetGlobalMouseState, where the position will then be calculated with the current Mouse.WindowHandle position. For now, the best you'll get is setting the WindowHandle and then using SetPosition to warp the mouse to the window, where I believe it should give proper coordinates. (That, or you can request focus with SDL_RaiseWindow.)
The Graphics subsystem is where compatibility will get interesting due to the nature of GL contexts.
Like D3D, a GraphicsDevice is storing its own rendering context, along with a window pointer to present to. You could attempt to use a single GraphicsDevice on multiple windows by getting ugly with SDL_GL_MakeCurrent, but calls to SDL_GL_MakeCurrent are very very slow (and often unstable) and you probably want to avoid it. This might be possible to do on FNA's end, but again, this would be entirely at your own risk... you'd have to swap out the contexts in these places:
Unset GLDevice window, set overrideWindowHandle, undo when complete (4 MakeCurrents):
https://github.com/flibitijibibo/FNA/blob/master/src/Graphics/OpenGLDevice.cs#L873
Unset GLDevice window, assign new window from PresentationParameters, set (2 MakeCurrents):
https://github.com/flibitijibibo/FNA/blob/master/src/Graphics/OpenGLDevice.cs#L807
Reset THREADED_GL, where applicable (init is at this location):
https://github.com/flibitijibibo/FNA/blob/master/src/Graphics/OpenGLDevice.cs#L4570
A slightly easier way to deal with all of this is to just use a second GraphicsDevice next to the second window, and use that GraphicsDevice independently of the rest of XNA (load your own textures/buffers/etc.), and call GraphicsDevice.Present() when the frame is ready.
from fna-mghistory.
Closing due to old age.
from fna-mghistory.
Related Issues (20)
- shader normalmap not work HOT 3
- Can't run on machine without audio device HOT 9
- [OpenGL] VMware/VBox Support? HOT 7
- [MojoShader] MOJOSHADER_glSetVertexAttribDivisor causes 'System.AccessViolationException' on some computers HOT 3
- [Keyboard] Proposal for Keyboard.GetLayoutEXT() HOT 1
- Microsoft.Xna.Framework.Input.GamePad.INTERNAL_AddInstance throws "An element with the same key already exists in the dictionary" HOT 2
- Triangle color is wrong with fairly simple shader + access violation exception HOT 7
- Unable to load a texture (.PNG) from stream HOT 9
- Initialization order mishap HOT 3
- GraphicsDeviceManager never set in Game HOT 1
- GL Object Disposal Wrappers are not thread-safe HOT 3
- DynamicSoundEffectInstance behavior incompatible with XNA4 HOT 8
- OpenGL 3.2+ Core Profile support HOT 4
- Starting game in full screen bug HOT 8
- Null reference when disposing sound effect after checking sound device exists HOT 5
- [QUESTIONS] learning, using FNA HOT 3
- More spec-compliant Touch Support HOT 34
- FNA Binary Release HOT 1
- RasterizerState.MultiSampleAntiAlias not implemented HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fna-mghistory.