Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module App =
- [<InteropDll ("SDL2.dll")>]
- let init (title: string) =
- C<nativeint> <|
- @"
- static app_t app;
- SDL_Init (SDL_INIT_VIDEO);
- app.window =
- SDL_CreateWindow(
- title,
- SDL_WINDOWPOS_UNDEFINED,
- SDL_WINDOWPOS_UNDEFINED,
- 640, 480,
- SDL_WINDOW_OPENGL|SDL_WINDOW_RESIZABLE);
- SDL_GL_SetAttribute (SDL_GL_CONTEXT_MAJOR_VERSION, 3);
- SDL_GL_SetAttribute (SDL_GL_CONTEXT_MINOR_VERSION, 2);
- SDL_GL_SetAttribute (SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE);
- app.gl_context = SDL_GL_CreateContext (app.window);
- return &app;
- "
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement