Hi, Iāve been away for sometime but Iām back.
So SDL_Net is working? Iām going to try that out.
Meanwhile my game is working on Windows Phone (with some limitations).
I still have a problem with the viewport aspect ratio that I have to fix.
Iāll take this chance to make another question:
Is it possible to open a native pop up box on top of my app?
SDL_net is building successfully (for most WinRT platforms, including WinPhone 8+ ones), however itās untested at runtime, at least from my end. Perhaps others have had luck with it? Regardless, if youād like to try using it, a copy of this is available at https://bitbucket.org/DavidLudwig/sdl_net.
Regarding pop-ups, SDLās message box API is working, with a caveat that there is a limitation on the number of buttons each message box can display. I believe itās two for WinPhone and three for Win 8.x, but it might be vice-versa. Any more beyond that and Windows gets angry (and doesnāt display the message box).
Regarding pop-ups more complicated than simple message boxes, support for overlaying more complicated, Windows-native controls (via Windowsā new-ish XAML APIs) is still pending. Iāve started work on this, but itās not quite ready for use just yet.
Cheers!
ā David L.
Hi, is there any development on this: "Windows-native controls (via Windowsā new-ish XAML APIs)"
Thanks!
Hi, is there any development on this: āWindows-native controls (via Windowsā new-ish XAML APIs)ā
There has been some development, but it has been somewhat slow going, in large part due to time constraints on my part. That being said, I do have some working, but not entirely feature-complete code ready. I donāt think that itās quite ready to be pushed out to the main SDL repository, but Iād be happy to post it in a separate repo, for the time being. I could definitely use some testers on this.
If youāre interested in an early version of XAML support, a few notes + warnings first:
rendering + event-processing is, currently, callback-driven. I.e. instead of having a typical main loop like this:
Code:
while (AppIsRunning()) {
ProcessEvents();
UpdateStuff();
RenderStuff();
}
ā¦ youāll have to have an app thatās callback based, and is more like this, conceptually:
If youāre interested in an early version of XAML support, a few notes + warnings first:
Additional notes:
For now, youāll have to create the XAML controls yourself (in Visual Studio, for example), then pass a pointer to the control into SDL, via SDL_CreateWindowFrom. It might be possible to eventually have SDL create a base set of XAML controls, but for now, the implementation assumes that one creates this ahead of time, either by hand, and/or through Visual Studioās XAML layout tools.
Support is currently limited to Windows Phone 8.1 (and Windows 8.1). It uses the āSwapChainPanelā XAML control, which was added as part of Win[Phone] 8.1.
Support for Windows Phone 8.0 is not available. WinPhone 8.0 used a vastly different XAML/Direct3D interop API, one that I believe has been deprecated, and is trickier to initialize from C/C++ code (than newer APIs that were introduced in Win[Phone] 8.1). I donāt have any plans, as of yet, to write support for this, especially given that WinPhone 8.1ās usage is now higher than WinPhone 8.0ās. (Non-XAML support is still available in SDL2 for WinPhone 8.0, however.)
Hi, is there any development on this: āWindows-native controls (via Windowsā new-ish XAML APIs)ā
There has been some development, but it has been somewhat slow going, in large part due to time constraints on my part. That being said, I do have some working, but not entirely feature-complete code ready. I donāt think that itās quite ready to be pushed out to the main SDL repository, but Iād be happy to post it in a separate repo, for the time being. I could definitely use some testers on this.
If youāre interested in an early version of XAML support, a few notes + warnings first:
rendering + event-processing is, currently, callback-driven. I.e. instead of having a typical main loop like this:
Code:
while (AppIsRunning()) {
ProcessEvents();
UpdateStuff();
RenderStuff();
}
ā¦ youāll have to have an app thatās callback based, and is more like this, conceptually:
I think that the former style will eventually be possible, but due to thread-related limitations in the XAML APIs, itās somewhat tricky.
keyboard input is currently non-functional. I suspect that this will work, eventually.
OpenGL ES rendering is currently non-function. I suspect that this will also work, eventually. SDL_Renderer support is working though.
Let me know if youāre interested, and Iāll plan on putting current work online at some point in the next week or two.
Cheers,
ā David L.
Well, my game fully depends on Open GL ES for rendering. My main interest in XAML controls is because I need to display a few message boxes. Maybe I can get away with the SDL message box.
My game is out for iOS and Android. Iām really interested on geting it in the Windows Phone too. It is actually working on WP, but I have some rendering issues and Iām not displaying the message boxes.
Hi, is there any development on this: āWindows-native controls (via Windowsā new-ish XAML APIs)ā
There has been some development, but it has been somewhat slow going, in large part due to time constraints on my part. That being said, I do have some working, but not entirely feature-complete code ready. I donāt think that itās quite ready to be pushed out to the main SDL repository, but Iād be happy to post it in a separate repo, for the time being. I could definitely use some testers on this.
If youāre interested in an early version of XAML support, a few notes + warnings first:
rendering + event-processing is, currently, callback-driven. I.e. instead of having a typical main loop like this:
Code:
while (AppIsRunning()) {
ProcessEvents();
UpdateStuff();
RenderStuff();
}
ā¦ youāll have to have an app thatās callback based, and is more like this, conceptually:
I think that the former style will eventually be possible, but due to thread-related limitations in the XAML APIs, itās somewhat tricky.
keyboard input is currently non-functional. I suspect that this will work, eventually.
OpenGL ES rendering is currently non-function. I suspect that this will also work, eventually. SDL_Renderer support is working though.
Let me know if youāre interested, and Iāll plan on putting current work online at some point in the next week or two.
Cheers,
ā David L.
Well, my game fully depends on Open GL ES for rendering. My main interest in XAML controls is because I need to display a few message boxes. Maybe I can get away with the SDL message box.
My game is out for iOS and Android. Iām really interested on geting it in the Windows Phone too. It is actually working on WP, but I have some rendering issues and Iām not displaying the message boxes.
Forgot to add a few things: The main loop you described seems to be like the one in iOS. It works with a callback.
On Windows Phone Iām actually rendering using Direct3d.
Limanima, if your game depends on OpenGL ES, then you can use ANGLE (https://github.com/MSOpenTech/angle/issues/32). There is XAML template in repository. I ported my game to windows 8.1, using SDL and ANGLE XAML template, with xaml controls too. You could use their project template without creating SDL window, but you need add your own handlers to process touch events (and may be suspend/restore), like this
Limanima, if your game depends on OpenGL ES, then you can use ANGLE (https://github.com/MSOpenTech/angle/issues/32). There is XAML template in repository. I ported my game to windows 8.1, using SDL and ANGLE XAML template, with xaml controls too. You could use their project template without creating SDL window, but you need add your own handlers to process touch events (and may be suspend/restore), like this
Well, my game fully depends on Open GL ES for rendering. My main interest in XAML controls is because I need to display a few message boxes. Maybe I can get away with the SDL message box.
My game is out for iOS and Android. Iām really interested on geting it in the Windows Phone too. It is actually working on WP, but I have some rendering issues and Iām not displaying the message boxes.
There is limited support for SDLās message-box API in SDL/WinRT. On Windows Phone, due to platform limitations, itās currently limited to showing message boxes with two buttons, and no-colorization. If thatās ok for you, then Iād say go for it. Itād probably be a lot simpler than adopting XAML.
If you end up wanting/needing XAML support, Iāve posted my on-going work at https://bitbucket.org/davidludwig/sdl . Iāve added the aforementioned SDL_CreateWindowFrom() modifications, as well as a new function to setup a rendering callback from C code. That new function is, to note, āint SDL_WinRTXAMLSetAnimationCallback(void (callback)(void), void *callbackParam);ā. Using it should, in theory, be akin to using SDL_iPhoneSetAnimationCallback, but with less parameters.
No OpenGL support just yet, but Iāll try getting to that ASAP. I have some code for that in the works, but itās not quite working just yet. Iāll give it another shot in the next week or two. No guarantees though. :-/
Regarding custom rendering, in theory, it should be possible to setup Direct3D 11 independently of SDL, even with the new XAML code. Just create your swap chain, passing in the SwapChainPanel as input instead of the CoreWindow. If you could use some sample code there, thereās some scattered on MSDN. SDLās D3D11 renderer (in that unofficial repo) has some as well (look for āD3D11_CreateSwapChainā). Just note, SDLās video APIs are pretty much limited to being run on the appās UI thread for now (when using XAML support).
If you use it, and run into any problems with it, or have questions, let me know and Iāll try to address them.
Cheers!
ā David L.
Yes, maybe I can get away with the SDLās Message Box. Iām using message boxes to display some network errors when accessing leaderboards (which Iām not going to support in the Windows Phone version). So I guess I will not need message boxes.
I have just a few rendering bugs to solve and the game will be ready on Windows Phone too.
Well, my game fully depends on Open GL ES for rendering. My main interest in XAML controls is because I need to display a few message boxes. Maybe I can get away with the SDL message box.
My game is out for iOS and Android. Iām really interested on geting it in the Windows Phone too. It is actually working on WP, but I have some rendering issues and Iām not displaying the message boxes.
There is limited support for SDLās message-box API in SDL/WinRT. On Windows Phone, due to platform limitations, itās currently limited to showing message boxes with two buttons, and no-colorization. If thatās ok for you, then Iād say go for it. Itād probably be a lot simpler than adopting XAML.
If you end up wanting/needing XAML support, Iāve posted my on-going work at https://bitbucket.org/davidludwig/sdl . Iāve added the aforementioned SDL_CreateWindowFrom() modifications, as well as a new function to setup a rendering callback from C code. That new function is, to note, āint SDL_WinRTXAMLSetAnimationCallback(void (callback)(void), void *callbackParam);ā. Using it should, in theory, be akin to using SDL_iPhoneSetAnimationCallback, but with less parameters.
No OpenGL support just yet, but Iāll try getting to that ASAP. I have some code for that in the works, but itās not quite working just yet. Iāll give it another shot in the next week or two. No guarantees though. :-/
Regarding custom rendering, in theory, it should be possible to setup Direct3D 11 independently of SDL, even with the new XAML code. Just create your swap chain, passing in the SwapChainPanel as input instead of the CoreWindow. If you could use some sample code there, thereās some scattered on MSDN. SDLās D3D11 renderer (in that unofficial repo) has some as well (look for āD3D11_CreateSwapChainā). Just note, SDLās video APIs are pretty much limited to being run on the appās UI thread for now (when using XAML support).
If you use it, and run into any problems with it, or have questions, let me know and Iāll try to address them.
Cheers!
ā David L.
Yes, maybe I can get away with the SDLās Message Box. Iām using message boxes to display some network errors when accessing leaderboards (which Iām not going to support in the Windows Phone version). So I guess I will not need message boxes.
I have just a few rendering bugs to solve and the game will be ready on Windows Phone too.
Now I remember why I really need xaml! I want to integrate Google AdMob on Windows Phone too (I already have AdMob working on iOS/Android).
Do you think it will be possible to integrate that? Iām almost sure I will have to go the xaml way.
Now I remember why I really need xaml! I want to integrate Google AdMob on Windows Phone too (I already have AdMob working on iOS/Android).
Do you think it will be possible to integrate that? Iām almost sure I will have to go the xaml way.
Maybe? Iāve never worked with AdMob on Windows Phone before, and canāt tell if itāll work or not.
My guess is that if AdMob works fine with a SwapChainPanel, itāll work fine with what Iām working on. I vaguely recall someone at Microsoft saying, via a Github-hosted site for ANGLE/WinRT, that ANGLE + SwapChainPanel + AdMob worked for them, but Iām not certain of that.
Now I remember why I really need xaml! I want to integrate Google AdMob on Windows Phone too (I already have AdMob working on iOS/Android).
Do you think it will be possible to integrate that? Iām almost sure I will have to go the xaml way.
Maybe? Iāve never worked with AdMob on Windows Phone before, and canāt tell if itāll work or not.
My guess is that if AdMob works fine with a SwapChainPanel, itāll work fine with what Iām working on. I vaguely recall someone at Microsoft saying, via a Github-hosted site for ANGLE/WinRT, that ANGLE + SwapChainPanel + AdMob worked for them, but Iām not certain of that.
ā David L.
Iām going to take a look at the AdMob api for Windows Phone. I have no idea how that works.
Now I remember why I really need xaml! I want to integrate Google AdMob on Windows Phone too (I already have AdMob working on iOS/Android).
Do you think it will be possible to integrate that? Iām almost sure I will have to go the xaml way.
Maybe? Iāve never worked with AdMob on Windows Phone before, and canāt tell if itāll work or not.
My guess is that if AdMob works fine with a SwapChainPanel, itāll work fine with what Iām working on. I vaguely recall someone at Microsoft saying, via a Github-hosted site for ANGLE/WinRT, that ANGLE + SwapChainPanel + AdMob worked for them, but Iām not certain of that.
ā David L.
Iām going to take a look at the AdMob api for Windows Phone. I have no idea how that works.
Alright, the AdMob is API is a C# component. Itās seems to be very easy to integrate, and only a few lines of code are needed.
Here is the code:
AdView bannerAd = new AdView
{
Format = AdFormats.BANNER,
AdUnitID = "MY_AD_UNIT_ID"
};
AdRequest adRequest = new AdRequest();
// Assumes we've defined a Grid that has a name
// directive of ContentPanel.
ContentPanel.Children.Add(bannerAd);
bannerAd.LoadAd(adRequest);
It seems that the ad is displayed in a web browser control that has to be attached to a xaml control.
My doubts with this are:
-Is is possible to call C# code from c++?
-Can I have access to any child control created by SDL that I can use to attach the AdView?
I have this feeling that it will be hard to make this work.
For starters a regular c++ project will not suffice. Iāll have to create a C# XAML app. Iām unable to add a reference to the C# AdMob component from a c++ project.
Thereās a project template in VS 2013 that creates a C# XMAL app that uses Direct 3D thru a C++ component, so I guess it will be possible to use SDL with a c# app.
Alright, the AdMob is API is a C# component. Itās seems to be very easy to integrate, and only a few lines of code are needed.
Limanima wrote:
It seems that the ad is displayed in a web browser control that has to be attached to a xaml control.
My doubts with this are:
-Is is possible to call C# code from c++?
-Can I have access to any child control created by SDL that I can use to attach the AdView?
I have this feeling that it will be hard to make this work.
For starters a regular c++ project will not suffice. Iāll have to create a C# XAML app. Iām unable to add a reference to the C# AdMob component from a c++ project.
Thereās a project template in VS 2013 that creates a C# XMAL app that uses Direct 3D thru a C++ component, so I guess it will be possible to use SDL with a c# app.
A few notes on this:
Their sample code is in C#, but Microsoftās most recent XAML framework, on Windows Phone 8.1, allows controls to be written in one of a few languages (that WinRT supports), then lets any WinRT language use them. Assuming the AdMob API uses WinRT XAML, and not an older, non-WinRT iteration of XAML, you might just be able to create and include the control from C++. (I.e. within WinRT, it is possible to do cross-language calls, but I suspect itās possible to integrate an SDK like this without doing such, although I might be mistaken. :-/ )
My current SDL/WinRT+XAML work doesnāt do anything, per-se, to create XAML controls. It currently requires that a āSwapChainPanelā XAML control be created first, then it allows SDL to work with it. I.e. in this case, for the time being, you could create the controls yourself, then hook up SDL to the appropriate one.
Their sample code is in C#, but Microsoftās most recent XAML framework, on Windows Phone 8.1, allows controls to be written in one of a few languages (that WinRT supports), then lets any WinRT language use them. Assuming the AdMob API uses WinRT XAML, and not an older, non-WinRT iteration of XAML, you might just be able to create and include the control from C++. (I.e. within WinRT, it is possible to do cross-language calls, but I suspect itās possible to integrate an SDK like this without doing such, although I might be mistaken. :-/ )
My current SDL/WinRT+XAML work doesnāt do anything, per-se, to create XAML controls. It currently requires that a āSwapChainPanelā XAML control be created first, then it allows SDL to work with it. I.e. in this case, for the time being, you could create the controls yourself, then hook up SDL to the appropriate one.
Make sense?
It probably does!
Iāve downloaded your SDL source and Iām going to download the SDLWinRTTestApp and run a few tests.
Iāve downloaded your SDL source and Iām going to download the SDLWinRTTestApp and run a few tests.
SDLWinRTTestApp doesnāt yet have XAML test code in it. Itās also got a lot of cruft, largely used by me to test various things in and around SDL.
Iāve posted a simpler, XAML-specific, skeleton project at: https://bitbucket.org/DavidLudwig/sdlskeletonxaml81 . Itās basically MSVCās Universal (for Windows 8.1 and Windows Phone 8.1) āBlank Appā template, with a few minor modifications, and a tiny bit of sample SDL code. When run, itāll attempt to use SDL to clear the screen to a solid green color.
Iāve downloaded your SDL source and Iām going to download the SDLWinRTTestApp and run a few tests.
SDLWinRTTestApp doesnāt yet have XAML test code in it. Itās also got a lot of cruft, largely used by me to test various things in and around SDL.
Iāve posted a simpler, XAML-specific, skeleton project at: https://bitbucket.org/DavidLudwig/sdlskeletonxaml81 . Itās basically MSVCās Universal (for Windows 8.1 and Windows Phone 8.1) āBlank Appā template, with a few minor modifications, and a tiny bit of sample SDL code. When run, itāll attempt to use SDL to clear the screen to a solid green color.
Iāve downloaded your SDL source and Iām going to download the SDLWinRTTestApp and run a few tests.
SDLWinRTTestApp doesnāt yet have XAML test code in it. Itās also got a lot of cruft, largely used by me to test various things in and around SDL.
Iāve posted a simpler, XAML-specific, skeleton project at: https://bitbucket.org/DavidLudwig/sdlskeletonxaml81 . Itās basically MSVCās Universal (for Windows 8.1 and Windows Phone 8.1) āBlank Appā template, with a few minor modifications, and a tiny bit of sample SDL code. When run, itāll attempt to use SDL to clear the screen to a solid green color.
Cheers!
ā David L.
Iām checking that out as we speak. Thanks!
Alright, I think Iām on the right path. Your template was of much help.
I had to do a few things though. Update from VS2012 to VS2013. My projects were targeting wp 8.0, I had to create new ones to target wp 8.1.
Iām starting to get this xaml thing.
Iāve downloaded your SDL source and Iām going to download the SDLWinRTTestApp and run a few tests.
SDLWinRTTestApp doesnāt yet have XAML test code in it. Itās also got a lot of cruft, largely used by me to test various things in and around SDL.
Iāve posted a simpler, XAML-specific, skeleton project at: https://bitbucket.org/DavidLudwig/sdlskeletonxaml81 . Itās basically MSVCās Universal (for Windows 8.1 and Windows Phone 8.1) āBlank Appā template, with a few minor modifications, and a tiny bit of sample SDL code. When run, itāll attempt to use SDL to clear the screen to a solid green color.
Cheers!
ā David L.
Iāve been quite busy between my website, supporting my just released game, getting my other game ready to be released on Steam that I almost have no time to get back to this.
But Iāve made a few tests, but Iām unable to get the thing to work.
SDL_CreateRenderer is failing. Iāve tried it on your template project and it is also failing with the same error. Iāve stepped into SDL_CreateRenderer and the function that is failing is IDXGIFactory2_CreateSwapChainForComposition.
This is the error message(hresult=0x887a0001)
āThe application made a call that is invalid. Either the parameters of the call or the state of some object was incorrect.\r\nEnable the D3D debug layer in order to see details via debug messagesā
Iāve already enabled d3d debug layer but I canāt see any additional information.
Iām running a ARM build on a Lumia 520. Not sure if that matters. Any ideas?