Skip to content

Commit

Permalink
Merge pull request #30 from lesleyrs/msvc-fixes
Browse files Browse the repository at this point in the history
fix(msvc): cpp cast error, .rh header redefinition warnings
  • Loading branch information
ColleagueRiley authored Aug 13, 2024
2 parents bff71c9 + 459c797 commit e068aa5
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions RGFW.h
Original file line number Diff line number Diff line change
Expand Up @@ -1834,7 +1834,7 @@ void RGFW_updateLockState(RGFW_window* win, b8 capital, b8 numlock) {
#endif

/*
graphics API spcific code (end of generic code)
graphics API specific code (end of generic code)
starts here
*/

Expand All @@ -1846,6 +1846,7 @@ void RGFW_updateLockState(RGFW_window* win, b8 capital, b8 numlock) {
#if defined(RGFW_OPENGL) || defined(RGFW_EGL) || defined(RGFW_OSMESA)
#ifdef RGFW_WINDOWS
#define WIN32_LEAN_AND_MEAN
#define OEMRESOURCE
#include <windows.h>
#endif

Expand Down Expand Up @@ -5008,15 +5009,15 @@ static const struct wl_callback_listener wl_surface_frame_listener = {

#ifdef RGFW_WINDOWS
#define WIN32_LEAN_AND_MEAN
#define OEMRESOURCE
#include <windows.h>

#include <processthreadsapi.h>
#include <wchar.h>
#include <locale.h>
#include <windowsx.h>
#include <shellapi.h>
#include <shellscalingapi.h>
#include <windows.h>
#include <winuser.rh>

#ifndef RGFW_NO_XINPUT
typedef DWORD (WINAPI * PFN_XInputGetState)(DWORD,XINPUT_STATE*);
Expand Down Expand Up @@ -5435,7 +5436,7 @@ RGFW_UNUSED(win); /*!< if buffer rendering is not being used */

/* try to create the pixel format we want for opengl and then try to create an opengl context for the specified version */
if (wglCreateContextAttribsARB != NULL) {
PIXELFORMATDESCRIPTOR pfd = (PIXELFORMATDESCRIPTOR){ sizeof(pfd), 1, pfd_flags, PFD_TYPE_RGBA, 32, 8, PFD_MAIN_PLANE, 24, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
PIXELFORMATDESCRIPTOR pfd = {sizeof(pfd), 1, pfd_flags, PFD_TYPE_RGBA, 32, 8, PFD_MAIN_PLANE, 24, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};

if (args & RGFW_OPENGL_SOFTWARE)
pfd.dwFlags |= PFD_GENERIC_FORMAT | PFD_GENERIC_ACCELERATED;
Expand Down

0 comments on commit e068aa5

Please sign in to comment.