Advertisement
Guest User

Untitled

a guest
Feb 19th, 2014
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
F# 0.59 KB | None | 0 0
  1. module App =
  2.     [<InteropDll ("SDL2.dll")>]
  3.     let init (title: string) =
  4.         C<nativeint> <|
  5.         @"
  6.         static app_t app;
  7.  
  8.         SDL_Init (SDL_INIT_VIDEO);
  9.  
  10.         app.window =
  11.             SDL_CreateWindow(
  12.                 title,
  13.                 SDL_WINDOWPOS_UNDEFINED,
  14.                 SDL_WINDOWPOS_UNDEFINED,
  15.                 640, 480,
  16.                 SDL_WINDOW_OPENGL|SDL_WINDOW_RESIZABLE);
  17.  
  18.         SDL_GL_SetAttribute (SDL_GL_CONTEXT_MAJOR_VERSION, 3);
  19.         SDL_GL_SetAttribute (SDL_GL_CONTEXT_MINOR_VERSION, 2);
  20.         SDL_GL_SetAttribute (SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE);
  21.  
  22.         app.gl_context = SDL_GL_CreateContext (app.window);
  23.  
  24.         return &app;
  25.         "
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement