admin管理员组文章数量:1130725
Im trying to open a sdl window using SDL2.Bindings(link) but its not working and nothing is happening and sometimes it says that initwin is static when i havent defined it as static
global using System;
global using System.Collections.Generic;
global using System.Text;
global using System.Threading.Tasks;
global using System.IO;
global using Vulkan;
global using SDL2.NET;
global using GlmNet;
global using sdl = SDL2.Bindings.SDL;
public static class albireo {
public static int initwin(string name, int x, int y) {
int r = 0;
if(sdl.SDL_Init(sdl.SDL_INIT_VIDEO) < 0)
{
Console.WriteLine("Failed to initialize the SDL2 library");
return -1;
}
IntPtr window = sdl.SDL_CreateWindow(name,
sdl.SDL_WINDOWPOS_CENTERED,
sdl.SDL_WINDOWPOS_CENTERED,
x, y,
0);
if(window == IntPtr.Zero)
{
Console.WriteLine("Failed to create window");
r = -1;
}
IntPtr window_surface = sdl.SDL_GetWindowSurface(window);
if(window_surface == IntPtr.Zero)
{
Console.WriteLine("Failed to get the surface from the window");
r = -1;
}
sdl.SDL_UpdateWindowSurface(window);
return r;
}
}
namespace thingy {
class program {
static void main() {
albireo.initwin("window", 800, 600);
}
}
}
i was expecting a window to open but its not
本文标签: sdlHow do i use SDL2Bindings in c to open a windowStack Overflow
版权声明:本文标题:sdl - How do i use SDL2.Bindings in c# to open a window - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736758671a1951426.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论