Big changes

This commit is contained in:
Kirill Yurkin
2025-03-07 16:54:27 +03:00
parent dd05797b95
commit 719171e7d8
21 changed files with 817 additions and 285 deletions

View File

@@ -1,14 +1,13 @@
#include "render/render.h"
#include "render/renderdevice.h"
#include "render/gl_shared.h"
#include "input/inputsystem.h"
#include "utils/logger.h"
#define RENDER_CLASS_NAME "RenderClassName"
#define RENDER_WINDOW_NAME "UNEASE Alpha"
HWND hWnd = NULL;
HDC hDC = NULL;
HGLRC hRC = NULL;
LRESULT CALLBACK WndProc (HWND hWnd, UINT message,
WPARAM wParam, LPARAM lParam)
@@ -75,33 +74,6 @@ void R_CreateWindow(int width, int height)
LogMsg("Created window %ix%i", width, height);
// create opengl context
PIXELFORMATDESCRIPTOR pfd;
int iFormat;
/* get the device context (DC) */
hDC = GetDC (hWnd);
/* set the pixel format for the DC */
ZeroMemory (&pfd, sizeof (pfd));
pfd.nSize = sizeof (pfd);
pfd.nVersion = 1;
pfd.dwFlags = PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER;
pfd.iPixelType = PFD_TYPE_RGBA;
pfd.cColorBits = 24;
pfd.cDepthBits = 16;
pfd.iLayerType = PFD_MAIN_PLANE;
iFormat = ChoosePixelFormat (hDC, &pfd);
SetPixelFormat (hDC, iFormat, &pfd);
LogMsg("SetPixelFormat successful");
/* create and enable the render context (RC) */
hRC = wglCreateContext( hDC );
LogMsg("wglCreateContext successful");
wglMakeCurrent( hDC, hRC );
}
void R_Init()
@@ -129,5 +101,10 @@ void R_Shutdown()
void R_Present()
{
SwapBuffers(hDC);
}
GL_SwapBuffers(0);
}
void* R_GetWindow()
{
return hWnd;
}