Added default window widht, height, x, and y to PLTF
This commit is contained in:
@@ -3,6 +3,11 @@
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
#define PLTF_DEFAULT_WINDOW_WIDTH 1280
|
||||
#define PLTF_DEFAULT_WINDOW_HEIGHT 720
|
||||
#define PLTF_DEFAULT_WINDOW_X 0
|
||||
#define PLTF_DEFAULT_WINDOW_Y 0
|
||||
|
||||
typedef enum {
|
||||
PLTF_WE_NONE,
|
||||
PLTF_WE_DESTROY,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#include "pltf/pltf.h"
|
||||
#ifdef _WIN32
|
||||
|
||||
#include <GL/glcorearb.h>
|
||||
@@ -42,6 +43,17 @@ void pltf_deinit() {
|
||||
|
||||
void pltf_window_create() {
|
||||
// Create the window
|
||||
DWORD window_style = WS_OVERLAPPEDWINDOW;
|
||||
RECT window_size_rect = (RECT) {
|
||||
.left = 0,
|
||||
.top = 0,
|
||||
.right = PLTF_DEFAULT_WINDOW_WIDTH,
|
||||
.bottom = PLTF_DEFAULT_WINDOW_HEIGHT
|
||||
};
|
||||
if (!AdjustWindowRectEx(&window_size_rect, window_style, false, 0)) {
|
||||
LOG_FATAL("Failed to adjust window size\n");
|
||||
}
|
||||
printf("Adjuested:\nright: %ld\nbottom: %ld\n", window_size_rect.right, window_size_rect.bottom);
|
||||
pltf_state.hwnd = CreateWindowEx(
|
||||
0, // Optional window styles
|
||||
pltf_state.wc_name, // Window class
|
||||
@@ -49,7 +61,10 @@ void pltf_window_create() {
|
||||
WS_OVERLAPPEDWINDOW, // Window style
|
||||
|
||||
// Size and position
|
||||
CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
|
||||
PLTF_DEFAULT_WINDOW_X,
|
||||
PLTF_DEFAULT_WINDOW_Y,
|
||||
PLTF_DEFAULT_WINDOW_WIDTH,
|
||||
PLTF_DEFAULT_WINDOW_HEIGHT,
|
||||
|
||||
NULL, // Parent window
|
||||
NULL, // Menu
|
||||
|
||||
Reference in New Issue
Block a user