Advertisement
snake5

wip opengl demo in temp lang

Jun 29th, 2017
433
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lisp 1.52 KB | None | 0 0
  1.  
  2. (impfunc GetModuleHandleA
  3.     (conv stdcall)
  4.     (ret intptr)
  5.     (arg intptr)
  6. )
  7.  
  8. (class WNDCLASS
  9.     (var style u32)             // UINT
  10.     (var lpfnWndProc intptr)    // WNDPROC
  11.     (var cbClsExtra i32)        // INT
  12.     (var cbWndExtra i32)        // INT
  13.     (var hInstance intptr)      // HINSTANCE
  14.     (var hIcon intptr)          // HICON
  15.     (var hCursor intptr)        // HCURSOR
  16.     (var hbrBackground intptr)  // HBRUSH
  17.     (var lpszMenuName intptr)   // LPCTSTR
  18.     (var lpszClassName intptr)  // LPCTSTR
  19. )
  20.  
  21. (impfunc DefWindowProcA
  22.     (conv stdcall)
  23.     (ret intptr) // LRESULT
  24.     (arg intptr) // HWND
  25.     (arg u32)    // UINT msg
  26.     (arg intptr) // WPARAM
  27.     (arg intptr) // LPARAM
  28. )
  29.  
  30. (func WndProc
  31.     (conv stdcall)
  32.     (ret intptr)        // LRESULT
  33.     (arg intptr hwnd)   // HWND
  34.     (arg u32    uMsg)   // UINT msg
  35.     (arg intptr wParam) // WPARAM
  36.     (arg intptr lParam) // LPARAM
  37.     (body
  38.         (return (call DefWindowProcA hwnd uMsg wParam lParam))
  39.     )
  40. )
  41.  
  42. (class OpenGLWindow
  43.     (var hInstance intptr (call GetModuleHandleA null))
  44.     (func __construct (body
  45.         (var wc (call WNDCLASS))
  46.         (set (getprop wc style) 0x23)             /* CS_HREDRAW | CS_VREDRAW | CS_OWNDC */
  47.         (set (getprop wc lpfnWndProc) WndProc)
  48.         (set (getprop wc hInstance) hInstance)
  49.         /*
  50.         wc.hIcon            = LoadIcon(NULL, IDI_WINLOGO);          // Load The Default Icon
  51.         wc.hCursor          = LoadCursor(NULL, IDC_ARROW);          // Load The Arrow Pointer
  52.         */
  53.         (set (getprop wc lpszClassName) (getprop "OpenGL Test" cStringPtr))
  54.     ))
  55. )
  56.  
  57. (func main
  58.     (ret void)
  59.     (body
  60.         (var window (call OpenGLWindow))
  61.     )
  62. )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement