Closed EnokViking closed 1 year ago
Oh, that is both weird and unexpected because those two things should be entirely unrelated to each other. I'll need to try and reproduce on my Windows machines.
Can you share a bit more information about your setup? At least Windows version and GPU vendor?
Hmm, I can't seem to reproduce the problem here (my config: Win10 Home 22H2, NVIDIA RTX 2070 driver version 528.24).
I used the clear-sapp sample, and added the following to the init() function:
switch (sg_query_backend()) {
case SG_BACKEND_D3D11: printf("Hello from D3D11\n"); break;
case SG_BACKEND_GLCORE33: printf("Hello from GL\n"); break;
case SG_BACKEND_METAL_MACOS: printf("Hello from Metal\n"); break;
default: printf("???\n");
}
...and changed sokol_main like this:
sapp_desc sokol_main(int argc, char* argv[]) {
(void)argc;
(void)argv;
return (sapp_desc){
//...
.win32_console_create = true,
.win32_console_utf8 = true,
};
}
Do you have some more information for me which would help me identifying the problem?
PS: screenshot
PPS: same result on my laptop which has the same Win10 build, but an integrated Intel HD Graphics 520 GPU.
I was reluctant to post this issue since I'm binding from another language(beef) and figured I was just doing something wrong on my end which turned out to be the case so you can sleep well tonight. There was a size mismatch of 8 bytes between the sapp_desc i was passing into sapp_run and the expected data. I stepped into sapp_run and verified that like so:
The culprit ended up being sapp_logger, I had simply forgotten to add the userdata member and that didn't occur to me since I was just copy-pasting the structs and changing the types.. >> Sorry for having you verify this, but thanks for the sanity check.
Hmm, reminds me that there's this language bindings generator PR which I still haven't looked into yet (which needs a bit of work though):
passing win32_console_attach OR create = true to sapp_run via sapp_desc when requesting an opengl context results in an erroneous state where context creation fails with the error: "WIN32_WGL_OPENGL_3_2_NOT_SUPPORTED: OpenGL 3.2 not supported by GL driver (ERROR_INVALID_VERSION_ARB) ./SokolApp.h, at line: 6642".