Replies: 5 comments 12 replies
-
fctr recommended the following... #define WIN32_LEAN_AND_MEAN
#if defined(_WIN32)
#define WIN32
#endif
#if defined(_WIN64)
#define WIN64
#define _AMD64_
#undef _X86_
#else
#undef _AMD64_
#define _X86_
#endif
#include <minwindef.h>
#include <stdio.h>
#include <stdlib.h> And change int main() to int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, char* pCmdLine, int nCmdShow) |
Beta Was this translation helpful? Give feedback.
-
Availleight had a C++ solution... namespace raylib{ #include "raylib.h" } And then use... raylib::BeginDrawing();
raylib::ClearBackground(raylib::Color{255,255,255,255});
raylib::EndDrawing(); |
Beta Was this translation helpful? Give feedback.
-
So, 38 years ago would be in the Win16 days of 1986 and in a form unrecognizable now. Did you miss the part where raylib is a descendant of the Borland Graphical Interface available for MS-DOS (and under the covers in Turbo Pascal) before Windows was established to any degree. I do not suggest that Microsoft should change anything or should have done so. They have legacy just as raylib does (on a much smaller scale). |
Beta Was this translation helpful? Give feedback.
-
If you only have limited surface of the windows API that you want to call, it is very feasible to just expose what you need manually. (extern "C") __declspec(dllimport) int MessageBoxA(void* hWND, const char* lpText, const char* lpCaption, unsigned int uType); The hardest part is peeling away the ugly macros and typedefs from the declarations, which can be tough, sometimes. This will also greatly improve compile times, a lone windows.h takes about ~0.9s to compile on my system with WIN32_LEAN_AND_MEAN, without it, it's even worse (~1.6s). Yes, precompiled headers help, but they add more build complexity. https://nullprogram.com/blog/2023/05/31/ |
Beta Was this translation helpful? Give feedback.
-
The "company bad open source project good" argument is silly. |
Beta Was this translation helpful? Give feedback.
-
Winapi's
windows.h
can have name conflicts with raylib.h . This is a space to talk about workarounds for it. While you are still able to compile raylib on windows, some people still want to use the winapi directly. This is a discussion space to discuss workarounds.Name Conflicts
References
Beta Was this translation helpful? Give feedback.
All reactions