-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to create a window using Native_Window parameter #16
Comments
Yes, this is what needs to happen on a platform specific basis if you want to create your window outside of SDL.
I left it this way as I cannot say which Windows bindings people will use, so U_C shouldn't have a problem converting between the two types. But your code really should be:
or
Where API is your Windows binding.
|
In other words, platform specifics like this, it shouldn't be added to the library, you should just create a function that will handle the conversion for you and put it in a platform specific directory and pick it up that way, unless the application isn't portable, then just in standard source somewhere. As I've not tested on Windows yet, this could be a size issue, not sure. As Windows32 is being phased out, i.e. AMD don't even have 32 bit drivers for R9 3xx series anymore for Windows 10, I'll only be supporting 64 bit windows with this lib. Can you provide a small test app which requires a native window with either a binding to the HWND or a link to the Windows API binding you're using? |
Test Native windows on:
|
Luke,
For my project I need to create a video window inside an existing windows control.
This can be done by specifying the hwnd of this control, and use it in SDL.Video.Windows.Makers.Create.
However I can not create the necessary parameter (Native : in Native_Window) based on my hwnd (i.e. Win32 handle or simply an Integer). For now I added a function in SDL.Video.Windows that uses unchecked_conversion to create a Native_Window variable:
function From_Hwnd (Hwnd : Integer) return Native_Window is
function To_Address is new Ada.Unchecked_Conversion (Source => Integer, Target => System.Address);
begin
return Native_Window (To_Address (Hwnd));
end From_Hwnd;
I have already tested this and it works!
Kind regards,
Rob
The text was updated successfully, but these errors were encountered: