├── Examples ├── CustomWndProc │ ├── Makefile │ ├── build.bat │ ├── clean.bat │ ├── include │ │ └── main.h │ └── source │ │ └── main.c ├── DynamicTemplate │ ├── Makefile │ ├── build.bat │ ├── clean.bat │ └── source │ │ └── main.c └── StaticTemplate │ ├── Makefile │ ├── build.bat │ ├── clean.bat │ └── source │ └── main.c ├── LDFS ├── Makefile ├── build.bat ├── clean.bat ├── include │ ├── LDFS.h │ ├── openGL.h │ ├── timer.h │ └── window.h └── source │ ├── LDFS.c │ ├── openGL.c │ ├── timer.c │ └── window.c └── README.md /Examples/CustomWndProc/Makefile: -------------------------------------------------------------------------------- 1 | CC := gcc 2 | SDIR := source 3 | IDIR := -Iinclude -I../../LDFS/include 4 | CFLAGS := $(IDIR) 5 | LFLAGS := ../../libstaticLDFS.a -lmingw32 -mwindows -lwinmm -lws2_32 -lopengl32 -lglu32 6 | ODIR := build 7 | CFILES := $(wildcard $(SDIR)/*.c) 8 | OBJS := $(patsubst $(SDIR)/%.c, build/%.o, $(wildcard $(SDIR)/*.c)) 9 | 10 | bin: $(ODIR) $(OBJS) 11 | $(CC) $(ODIR)/*.o -o bin.exe $(LFLAGS) 12 | 13 | $(ODIR)/%.o: $(SDIR)/%.c 14 | $(CC) -c -o $@ $< $(CFLAGS) 15 | 16 | $(ODIR): 17 | @mkdir $@ 18 | 19 | .PHONY: clean 20 | 21 | clean: 22 | rm -f *.exe $(ODIR)/*.o 23 | rmdir $(ODIR) 24 | -------------------------------------------------------------------------------- /Examples/CustomWndProc/build.bat: -------------------------------------------------------------------------------- 1 | make 2 | pause 3 | bin.exe 4 | pause -------------------------------------------------------------------------------- /Examples/CustomWndProc/clean.bat: -------------------------------------------------------------------------------- 1 | make clean 2 | pause -------------------------------------------------------------------------------- /Examples/CustomWndProc/include/main.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | extern unsigned char holdingSpace; 4 | extern float angle; 5 | 6 | LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam); 7 | -------------------------------------------------------------------------------- /Examples/CustomWndProc/source/main.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include "main.h" 6 | 7 | unsigned char holdingSpace = 0; 8 | float angle = 0.0f; 9 | 10 | int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int iCmdShow) { 11 | LDFS_Init(WndProc); 12 | LDFS_CreateWindow("test", 1, LDFS_AUTO, LDFS_AUTO); 13 | 14 | while(1) { 15 | if(LDFS_Update()) { 16 | 17 | glClearColor(0.0f, 0.0f, 0.0f, 0.0f); 18 | glClear(GL_COLOR_BUFFER_BIT); 19 | 20 | glPushMatrix(); 21 | glRotatef(angle, 0.0f, 0.0f, 1.0f); 22 | glBegin(GL_TRIANGLES); 23 | glColor3f(1.0f, 0.0f, 0.0f); glVertex2f(0.0f, 1.0f); 24 | glColor3f(0.0f, 1.0f, 0.0f); glVertex2f(0.87f, -0.5f); 25 | glColor3f(0.0f, 0.0f, 1.0f); glVertex2f(-0.87f, -0.5f); 26 | glEnd(); 27 | glPopMatrix(); 28 | 29 | if(holdingSpace) angle += 0.5f; 30 | 31 | LDFS_SwapBuffers(); 32 | 33 | } 34 | else { 35 | LDFS_DestroyWindow(); 36 | return 0; 37 | } 38 | } 39 | } 40 | 41 | LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { 42 | switch(message) { 43 | case WM_CREATE: 44 | return 0; 45 | 46 | case WM_CLOSE: 47 | PostQuitMessage(0); 48 | return 0; 49 | 50 | case WM_DESTROY: 51 | return 0; 52 | 53 | case WM_KEYDOWN: 54 | switch(wParam) { 55 | case VK_ESCAPE: 56 | PostQuitMessage(0); 57 | return 0; 58 | break; 59 | 60 | case VK_SPACE: 61 | if(!(lParam & 0x40000000)) holdingSpace = 1; 62 | break; 63 | } 64 | return 0; 65 | 66 | case WM_KEYUP: 67 | switch(wParam) { 68 | case VK_SPACE: 69 | holdingSpace = 0; 70 | } 71 | 72 | default: 73 | return DefWindowProc(hWnd, message, wParam, lParam); 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /Examples/DynamicTemplate/Makefile: -------------------------------------------------------------------------------- 1 | CC := gcc 2 | SDIR := source 3 | IDIR := -Iinclude -I../../LDFS/include 4 | CFLAGS := $(IDIR) 5 | LFLAGS := ../../libdynamicLDFS.a -lmingw32 -mwindows -lwinmm -lws2_32 -lopengl32 -lglu32 6 | ODIR := build 7 | CFILES := $(wildcard $(SDIR)/*.c) 8 | OBJS := $(patsubst $(SDIR)/%.c, build/%.o, $(wildcard $(SDIR)/*.c)) 9 | 10 | bin: $(ODIR) $(OBJS) 11 | $(CC) $(ODIR)/*.o -o bin.exe $(LFLAGS) 12 | 13 | $(ODIR)/%.o: $(SDIR)/%.c 14 | $(CC) -c -o $@ $< $(CFLAGS) 15 | 16 | $(ODIR): 17 | @mkdir $@ 18 | 19 | .PHONY: clean 20 | 21 | clean: 22 | rm -f *.exe $(ODIR)/*.o 23 | rmdir $(ODIR) 24 | -------------------------------------------------------------------------------- /Examples/DynamicTemplate/build.bat: -------------------------------------------------------------------------------- 1 | make 2 | pause 3 | bin.exe 4 | pause -------------------------------------------------------------------------------- /Examples/DynamicTemplate/clean.bat: -------------------------------------------------------------------------------- 1 | make clean 2 | pause -------------------------------------------------------------------------------- /Examples/DynamicTemplate/source/main.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int iCmdShow) { 6 | LDFS_Init(LDFS_DefaultWndProc); 7 | 8 | // window title, full screen, width, height 9 | // LDFS_AUTO gets the user's resolution for you so that the image isn't stretched 10 | LDFS_CreateWindow("test", 1, LDFS_AUTO, LDFS_AUTO); 11 | 12 | while(1) { 13 | if(LDFS_Update()) { 14 | 15 | glClearColor(0.0f, 0.0f, 0.0f, 0.0f); 16 | glClear(GL_COLOR_BUFFER_BIT); 17 | 18 | glPushMatrix(); 19 | glBegin(GL_TRIANGLES); 20 | glColor3f(1.0f, 0.0f, 0.0f); glVertex2f(0.0f, 1.0f); 21 | glColor3f(0.0f, 1.0f, 0.0f); glVertex2f(0.87f, -0.5f); 22 | glColor3f(0.0f, 0.0f, 1.0f); glVertex2f(-0.87f, -0.5f); 23 | glEnd(); 24 | glPopMatrix(); 25 | 26 | LDFS_SwapBuffers(); 27 | 28 | } 29 | else { 30 | LDFS_DestroyWindow(); 31 | return 0; 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Examples/StaticTemplate/Makefile: -------------------------------------------------------------------------------- 1 | CC := gcc 2 | SDIR := source 3 | IDIR := -Iinclude -I../../LDFS/include 4 | CFLAGS := $(IDIR) 5 | LFLAGS := ../../libstaticLDFS.a -lmingw32 -mwindows -lwinmm -lws2_32 -lopengl32 -lglu32 6 | ODIR := build 7 | CFILES := $(wildcard $(SDIR)/*.c) 8 | OBJS := $(patsubst $(SDIR)/%.c, build/%.o, $(wildcard $(SDIR)/*.c)) 9 | 10 | bin: $(ODIR) $(OBJS) 11 | $(CC) $(ODIR)/*.o -o bin.exe $(LFLAGS) 12 | 13 | $(ODIR)/%.o: $(SDIR)/%.c 14 | $(CC) -c -o $@ $< $(CFLAGS) 15 | 16 | $(ODIR): 17 | @mkdir $@ 18 | 19 | .PHONY: clean 20 | 21 | clean: 22 | rm -f *.exe $(ODIR)/*.o 23 | rmdir $(ODIR) 24 | -------------------------------------------------------------------------------- /Examples/StaticTemplate/build.bat: -------------------------------------------------------------------------------- 1 | make 2 | pause 3 | bin.exe 4 | pause -------------------------------------------------------------------------------- /Examples/StaticTemplate/clean.bat: -------------------------------------------------------------------------------- 1 | make clean 2 | pause -------------------------------------------------------------------------------- /Examples/StaticTemplate/source/main.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int iCmdShow) { 6 | LDFS_Init(LDFS_DefaultWndProc); 7 | 8 | // window title, full screen, width, height 9 | // LDFS_AUTO gets the user's resolution for you so that the image isn't stretched 10 | LDFS_CreateWindow("test", 1, LDFS_AUTO, LDFS_AUTO); 11 | 12 | while(1) { 13 | if(LDFS_Update()) { 14 | 15 | glClearColor(0.0f, 0.0f, 0.0f, 0.0f); 16 | glClear(GL_COLOR_BUFFER_BIT); 17 | 18 | glPushMatrix(); 19 | glBegin(GL_TRIANGLES); 20 | glColor3f(1.0f, 0.0f, 0.0f); glVertex2f(0.0f, 1.0f); 21 | glColor3f(0.0f, 1.0f, 0.0f); glVertex2f(0.87f, -0.5f); 22 | glColor3f(0.0f, 0.0f, 1.0f); glVertex2f(-0.87f, -0.5f); 23 | glEnd(); 24 | glPopMatrix(); 25 | 26 | LDFS_SwapBuffers(); 27 | 28 | } 29 | else { 30 | LDFS_DestroyWindow(); 31 | return 0; 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /LDFS/Makefile: -------------------------------------------------------------------------------- 1 | CC := gcc 2 | AR := ar 3 | SDIR := source 4 | IDIR := include 5 | CFLAGS := -I$(IDIR) -Ofast 6 | LFLAGS := -lmingw32 -mwindows -lwinmm -lws2_32 -lopengl32 -lglu32 7 | ODIR := build 8 | CFILES := $(wildcard $(SDIR)/*.c) 9 | OBJS := $(patsubst $(SDIR)/%.c, build/%.o, $(wildcard $(SDIR)/*.c)) 10 | 11 | .PHONY: all 12 | 13 | all: ../libdynamicLDFS.a ../LDFS.dll ../libstaticLDFS.a 14 | 15 | ../libdynamicLDFS.a ../LDFS.dll: $(ODIR) $(OBJS) 16 | $(CC) -shared -o ../LDFS.dll $(OBJS) -Wl,--out-implib,../libdynamicLDFS.a $(LFLAGS) 17 | 18 | ../libstaticLDFS.a: $(ODIR) $(OBJS) 19 | $(AR) rcs ../libstaticLDFS.a $(OBJS) 20 | 21 | $(ODIR)/%.o: $(SDIR)/%.c 22 | $(CC) -c -o $@ $< $(CFLAGS) $(LFLAGS) 23 | 24 | $(ODIR): 25 | @mkdir $@ 26 | 27 | .PHONY: clean 28 | 29 | clean: 30 | rm -f ../libdynamicLDFS.a ../LDFS.dll ../libstaticLDFS.a $(ODIR)/*.o 31 | rmdir $(ODIR) 32 | -------------------------------------------------------------------------------- /LDFS/build.bat: -------------------------------------------------------------------------------- 1 | make 2 | pause -------------------------------------------------------------------------------- /LDFS/clean.bat: -------------------------------------------------------------------------------- 1 | make clean 2 | pause -------------------------------------------------------------------------------- /LDFS/include/LDFS.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "window.h" 4 | #include "timer.h" 5 | 6 | void LDFS_Init(WNDPROC wndProc); 7 | -------------------------------------------------------------------------------- /LDFS/include/openGL.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | void LDFS_EnableOpenGL(HWND hWnd, HDC *hDC, HGLRC *hRC); 4 | void LDFS_DisableOpenGL(HWND hWnd, HDC hDC, HGLRC hRC); 5 | -------------------------------------------------------------------------------- /LDFS/include/timer.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | struct LDFS_Timer { 4 | __int64 frequency; 5 | float resolution; 6 | unsigned long multimediaTimerStart; 7 | unsigned long multimediaTimerElapsed; 8 | short usingPerformanceTimer; 9 | __int64 performanceTimerStart; 10 | __int64 performanceTimerElapsed; 11 | }; 12 | 13 | extern struct LDFS_Timer LDFS_Timer; 14 | extern double LDFS_Framerate; 15 | extern float LDFS_FrameStart; 16 | 17 | short LDFS_InitTimer(void); 18 | float LDFS_GetTime(void); 19 | inline void LDFS_SetFramerate(double framerate); 20 | void LDFS_MaintainFramerate(void); 21 | -------------------------------------------------------------------------------- /LDFS/include/window.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define LDFS_AUTO -1 4 | 5 | #define LDFS_CreateWindow(title, fullScreen, width, height) do { LDFS_CREATE_WINDOW(hInstance, hPrevInstance, lpCmdLine, iCmdShow, title, fullScreen, width, height); } while(0) 6 | 7 | extern WNDCLASS LDFS_wc; 8 | extern HWND LDFS_hWnd; 9 | extern HDC LDFS_hDC; 10 | extern HGLRC LDFS_hRC; 11 | extern MSG LDFS_msg; 12 | 13 | int LDFS_CREATE_WINDOW(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int iCmdShow, char *title, unsigned char fullScreen, int width, int height); 14 | unsigned char LDFS_Update(void); 15 | unsigned char LDFS_NoFramerateUpdate(void); 16 | inline void LDFS_SwapBuffers(void); 17 | void LDFS_DestroyWindow(void); 18 | LRESULT CALLBACK LDFS_DefaultWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam); 19 | -------------------------------------------------------------------------------- /LDFS/source/LDFS.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "LDFS.h" 4 | 5 | void LDFS_Init(WNDPROC wndProc) { 6 | memset(&LDFS_wc, '\0', sizeof(WNDPROC)); 7 | LDFS_wc.lpfnWndProc = wndProc; 8 | LDFS_InitTimer(); 9 | } 10 | -------------------------------------------------------------------------------- /LDFS/source/openGL.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "LDFS.h" 5 | 6 | void LDFS_EnableOpenGL(HWND LDFS_hWnd, HDC *LDFS_hDC, HGLRC *LDFS_hRC) { 7 | PIXELFORMATDESCRIPTOR pfd; 8 | int format; 9 | 10 | *LDFS_hDC = GetDC(LDFS_hWnd); 11 | 12 | ZeroMemory(&pfd, sizeof(pfd)); 13 | pfd.nSize = sizeof(pfd); 14 | pfd.nVersion = 1; 15 | pfd.dwFlags = PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER; 16 | pfd.iPixelType = PFD_TYPE_RGBA; 17 | pfd.cColorBits = 24; 18 | pfd.cDepthBits = 16; 19 | pfd.iLayerType = PFD_MAIN_PLANE; 20 | format = ChoosePixelFormat(*LDFS_hDC, &pfd); 21 | SetPixelFormat(*LDFS_hDC, format, &pfd); 22 | 23 | *LDFS_hRC = wglCreateContext(*LDFS_hDC); 24 | wglMakeCurrent(*LDFS_hDC, *LDFS_hRC); 25 | } 26 | 27 | void LDFS_DisableOpenGL(HWND LDFS_hWnd, HDC LDFS_hDC, HGLRC LDFS_hRC) { 28 | wglMakeCurrent(NULL, NULL); 29 | wglDeleteContext(LDFS_hRC); 30 | ReleaseDC(LDFS_hWnd, LDFS_hDC); 31 | } 32 | -------------------------------------------------------------------------------- /LDFS/source/timer.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "timer.h" 4 | 5 | struct LDFS_Timer LDFS_Timer; 6 | double LDFS_Framerate = 1.0f / 60.0f * 1000.0f; 7 | float LDFS_FrameStart; 8 | 9 | short LDFS_InitTimer(void) { 10 | memset(&LDFS_Timer, 0, sizeof(LDFS_Timer)); 11 | 12 | if(!QueryPerformanceFrequency((LARGE_INTEGER *)&LDFS_Timer.frequency)) { 13 | LDFS_Timer.usingPerformanceTimer = 0; 14 | LDFS_Timer.multimediaTimerStart = timeGetTime(); 15 | LDFS_Timer.resolution = 1.0f / 1000.0f; 16 | LDFS_Timer.frequency = 1000; 17 | LDFS_Timer.multimediaTimerElapsed = LDFS_Timer.multimediaTimerStart; 18 | return 0; 19 | } 20 | else { 21 | QueryPerformanceCounter((LARGE_INTEGER *) &LDFS_Timer.performanceTimerStart); 22 | LDFS_Timer.usingPerformanceTimer = 1; 23 | LDFS_Timer.resolution = (float)(((double)1.0f) / ((double)LDFS_Timer.frequency)); 24 | LDFS_Timer.performanceTimerElapsed = LDFS_Timer.performanceTimerStart; 25 | return 1; 26 | } 27 | 28 | LDFS_FrameStart = LDFS_GetTime(); 29 | } 30 | 31 | float LDFS_GetTime(void) { 32 | __int64 time; 33 | 34 | if(LDFS_Timer.usingPerformanceTimer) { 35 | QueryPerformanceCounter((LARGE_INTEGER *) &time); 36 | return ((float)(time - LDFS_Timer.performanceTimerStart) * LDFS_Timer.resolution) * 1000.0f; 37 | } 38 | else { 39 | return ((float)(timeGetTime() - LDFS_Timer.multimediaTimerStart) * LDFS_Timer.resolution) * 1000.0f; 40 | } 41 | } 42 | 43 | inline void LDFS_SetFramerate(double framerate) { 44 | LDFS_Framerate = framerate; 45 | } 46 | 47 | void LDFS_MaintainFramerate(void) { 48 | float t = LDFS_FrameStart + LDFS_Framerate - LDFS_GetTime(); 49 | if(t > 0) Sleep(t); 50 | 51 | LDFS_FrameStart = LDFS_GetTime(); 52 | } 53 | -------------------------------------------------------------------------------- /LDFS/source/window.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "LDFS.h" 5 | 6 | WNDCLASS LDFS_wc; 7 | HWND LDFS_hWnd; 8 | HDC LDFS_hDC; 9 | HGLRC LDFS_hRC; 10 | MSG LDFS_msg; 11 | 12 | int LDFS_CREATE_WINDOW(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int iCmdShow, char *title, unsigned char fullScreen, int width, int height) { 13 | LDFS_wc.style = CS_OWNDC; 14 | //LDFS_wc.lpfnWndProc = wndProc; 15 | LDFS_wc.cbClsExtra = 0; 16 | LDFS_wc.cbWndExtra = 0; 17 | LDFS_wc.hInstance = hInstance; 18 | LDFS_wc.hIcon = LoadIcon(NULL, IDI_APPLICATION); 19 | LDFS_wc.hCursor = LoadCursor(NULL, IDC_ARROW); 20 | LDFS_wc.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH); 21 | LDFS_wc.lpszMenuName = NULL; 22 | LDFS_wc.lpszClassName = "LDFSClass"; 23 | RegisterClass(&LDFS_wc); 24 | 25 | if(fullScreen) { 26 | if(width == LDFS_AUTO) width = GetSystemMetrics(SM_CXSCREEN); 27 | if(height == LDFS_AUTO) height = GetSystemMetrics(SM_CYSCREEN); 28 | 29 | LDFS_hWnd = CreateWindow("LDFSClass", title, WS_EX_TOPMOST | WS_POPUP, 0, 0, width, height, NULL, NULL, hInstance, NULL); 30 | ShowWindow(LDFS_hWnd, SW_MAXIMIZE); 31 | } 32 | else { 33 | if(width == LDFS_AUTO) width = 768; 34 | if(height == LDFS_AUTO) height = 576; 35 | 36 | LDFS_hWnd = CreateWindow("LDFSClass", title, WS_CAPTION | WS_POPUPWINDOW, 128, 128, width, height, NULL, NULL, hInstance, NULL); 37 | 38 | RECT rcClient, rcWindow; 39 | POINT ptDiff; 40 | GetClientRect(LDFS_hWnd, &rcClient); 41 | GetWindowRect(LDFS_hWnd, &rcWindow); 42 | ptDiff.x = (rcWindow.right - rcWindow.left) - rcClient.right; 43 | ptDiff.y = (rcWindow.bottom - rcWindow.top) - rcClient.bottom; 44 | MoveWindow(LDFS_hWnd, rcWindow.left, rcWindow.top, width + ptDiff.x, height + ptDiff.y, TRUE); 45 | 46 | ShowWindow(LDFS_hWnd, SW_SHOWNORMAL); 47 | } 48 | 49 | LDFS_EnableOpenGL(LDFS_hWnd, &LDFS_hDC, &LDFS_hRC); 50 | } 51 | 52 | unsigned char LDFS_Update(void) { 53 | LDFS_MaintainFramerate(); 54 | 55 | if(PeekMessage(&LDFS_msg, NULL, 0, 0, PM_REMOVE)) { 56 | if(LDFS_msg.message == WM_QUIT) { 57 | return 0; 58 | } 59 | else { 60 | TranslateMessage(&LDFS_msg); 61 | DispatchMessage(&LDFS_msg); 62 | } 63 | } 64 | 65 | return 1; 66 | } 67 | 68 | unsigned char LDFS_NoFramerateUpdate(void) { 69 | if(PeekMessage(&LDFS_msg, NULL, 0, 0, PM_REMOVE)) { 70 | if(LDFS_msg.message == WM_QUIT) { 71 | return 0; 72 | } 73 | else { 74 | TranslateMessage(&LDFS_msg); 75 | DispatchMessage(&LDFS_msg); 76 | } 77 | } 78 | 79 | return 1; 80 | } 81 | 82 | inline void LDFS_SwapBuffers(void) { 83 | SwapBuffers(LDFS_hDC); 84 | } 85 | 86 | void LDFS_DestroyWindow(void) { 87 | LDFS_DisableOpenGL(LDFS_hWnd, LDFS_hDC, LDFS_hRC); 88 | DestroyWindow(LDFS_hWnd); 89 | } 90 | 91 | LRESULT CALLBACK LDFS_DefaultWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { 92 | switch(message) { 93 | case WM_CREATE: 94 | return 0; 95 | 96 | case WM_CLOSE: 97 | PostQuitMessage(0); 98 | return 0; 99 | 100 | case WM_DESTROY: 101 | return 0; 102 | 103 | case WM_KEYDOWN: 104 | switch(wParam) { 105 | case VK_ESCAPE: 106 | PostQuitMessage(0); 107 | return 0; 108 | } 109 | return 0; 110 | 111 | default: 112 | return DefWindowProc(hWnd, message, wParam, lParam); 113 | } 114 | } 115 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | LDFS 2 | ==== 3 | 4 | LDFS, or "Lovely Day For Salsa" is an OpenGL Windowing System. 5 | 6 | It allows you to create a window with an OpenGL context, and then maintain a steady framerate. 7 | --------------------------------------------------------------------------------