giawa / opengl4csharp

OpenGL 4 Bindings (partially based on OpenTK) for C#
Other
232 stars 61 forks source link

Unable to find an entry point named 'SDL_Init' in DLL 'SDL2.dll' #7

Closed IDKJustPutSomething closed 7 years ago

IDKJustPutSomething commented 7 years ago

Hello, I am new to OpenGl in c# so sorry is this is a beginner issue. I got the above error when trying to run the following code.

OpenGL.Platform.Window.CreateWindow("OpenGL", 100, 100);

I have searched online to no avail. I have the OpenGL.dll, OpenGL.Platform.dll, and SDL2-DS.dll libraries included. When i try to add the SD2.dll that you link in your example it also gives me an error. Any help would be appreciated.

giawa commented 7 years ago

Hey there,

Did you put the SDL dll in the executable directory? You can't try to add the executable directly to your project (since the SDL dll is compiled code), but you will need to make sure it is in the search path of your executable. Hopefully that fixes the issue!

IDKJustPutSomething commented 7 years ago

I did put it in with the executable but i ended up fixing the problem by just using glut instead although i would still like to know what i did wrong.

Edit: After Changing around my code to make it easier to use and more readable i get an AccessViolationException when i call Gl.DrawElements

giawa commented 7 years ago

Strange, do you mind sending me two zip files? One with the SDL error and the other with the AccessViolationException? It would be helpful for me if I could reproduce them.

Cheers

IDKJustPutSomething commented 7 years ago

Here is the access violation. I deleted to project with the SDL error but i will see if i can recreate it.

https://www.dropbox.com/s/mtx5oghdeu7u5fs/2DEngine.zip?dl=0

giawa commented 7 years ago

Hey there,

Sorry for the delay in getting back to you. I'm on vacation for the next few weeks and internet is hard to come by. I was able to download your project, but didn't get an Access Violation when I ran it. I'll see what I can do to reproduce it - it's likely a difference in drivers (I'm using an Intel card). Let me know if you find the SDL issue as well and I'll try to reproduce it as well.

More soon!

giawa commented 7 years ago

I think you've switching over to using Glut instead, so I'm going to close this issue for now since it isn't related to the OpenGL repo. Thanks!