hajimehoshi / ebiten

Ebitengine - A dead simple 2D game engine for Go
https://ebitengine.org
Apache License 2.0
11.07k stars 662 forks source link

glfw: wglCreateContextAttribsARB failed: winapi error #3221692565 #3109

Open Bagi763 opened 2 months ago

Bagi763 commented 2 months ago

Ebitengine Version

lastest probabk=ly

Operating System

Go Version (go version)

1.23.1

What steps will reproduce the problem?

running the command to confirm my enviroment

What is the expected result?

image

What happens instead?

image

Anything else you feel useful to add?

maybe my pc is just bad and old, i know it doesn't run the lastest version of opengl (opengl 4.0, idk my version but is probably 2 or 3), maybe is that the problem, but there isn't a way to make it run on a older version of webgl??

hajimehoshi commented 2 months ago

What version of windows are you using?

Bagi763 commented 1 month ago

What version of windows are you using?

Windows 8.1, and I confirmed that I'm using opengl 2.1

hajimehoshi commented 1 month ago

Go itself no longer supports Windows 8.1. https://go.dev/wiki/Windows

Installing DirectX 11 might solve the issue.

Bagi763 commented 1 month ago

i installed directx 11 and didn't work i'm going to try to install directx 12 and see if works

Bagi763 commented 1 month ago

i couldn't find to install directx 12, so here is the screenshots image image

hajimehoshi commented 1 month ago

Could you try this command?

go run github.com/hajimehoshi/ebiten/v2/examples/windowsize@latest -graphicslibrary=directx
Bagi763 commented 1 month ago

worked, thanks image

just another question, every time i will run my game i will need to add -graphicslibrary=directx at the end, or there is some way of doing that automatically??

hajimehoshi commented 1 month ago

Thanks!

just another question, every time i will run my game i will need to add -graphicslibrary=directx at the end, or there is some way of doing that automatically??

Well, so the problem is, Ebitengine misunderstood that OpenGL was available in your machine but the actual it was not. I'll try to fix it by checking the OpenGL availability in a more strict way.

Bagi763 commented 1 month ago

ok thanks

hajimehoshi commented 1 month ago

I found this required a lot of refactoring in order to fix the issue correctly... (Related: #2714)

Until I can fix this issue, could you set an environment variable EBITENGINE_GRAPHICS_DRIVER to directx, so that every Ebitengine game would work with DirectX by default? I'm sorry for inconvenience. See https://docs.google.com/document/d/1djz7cUKPP2UTtyQD-aBb5836wPkqBDSOZYPhgCtJHRU/edit?usp=sharing (In this document, opengl is set to use OpenGL, but of course set directx in your case.)

Bagi763 commented 1 month ago

worked by default now image i very grateful for you responding to me, thanks