TeamAvocado / Avocado

A 3D engine written in the D programming language
Mozilla Public License 2.0
17 stars 1 forks source link

shooter-2d failing on macOS (OpenGL error) #7

Open p0nce opened 7 years ago

p0nce commented 7 years ago
~/Desktop/Avocado/examples/shooter-2d$ lldb sample-shooter-2d
(lldb) target create "sample-shooter-2d"
Current executable set to 'sample-shooter-2d' (x86_64).
(lldb) r
Process 1826 launched: '/Users/ponce/Desktop/Avocado/examples/shooter-2d/sample-shooter-2d' (x86_64)
renderer = avocado.gl3.gl3renderer.GL3Renderer
world = avocado.core.entity.world.World
object.Exception@../../components/gl3/source/avocado/gl3/gl3mesh.d(223): OpenGL error code: 1281 (0x0501) - GL_INVALID_VALUE
A numeric argument is out of range. The offending command is ignored and has no other side effect than to set the error flag.
----------------
4   sample-shooter-2d                   0x000000010004eeb6 void avocado.gl3.enforceGLErrors!(223, "../../components/gl3/source/avocado/gl3/gl3mesh.d").enforceGLErrors(immutable(char)[], bool) + 354
5   sample-shooter-2d                   0x000000010009aa0a avocado.core.display.imesh.IMesh avocado.gl3.gl3mesh.GL3Mesh!(avocado.gl3.gl3mesh.BufferElement!("Position", 2, float, false, 0, false).BufferElement).GL3Mesh.generate() + 170
6   sample-shooter-2d                   0x000000010000193e avocado.gl3.gl3mesh.GL3Mesh!(avocado.gl3.gl3mesh.BufferElement!("Position", 2, float, false, 0, false).BufferElement).GL3Mesh app.makeEntityShape(gl3n.linalg.Vector!(float, 2).Vector[]) + 90
7   sample-shooter-2d                   0x0000000100001a84 avocado.gl3.gl3mesh.GL3Mesh!(avocado.gl3.gl3mesh.BufferElement!("Position", 2, float, false, 0, false).BufferElement).GL3Mesh app.makeCircleShape(int, float) + 280
8   sample-shooter-2d                   0x00000001000027ce int app.Game.run() + 3394
9   sample-shooter-2d                   0x00000001000017d9 _Dmain + 41
10  sample-shooter-2d                   0x00000001000f3e7b D2rt6dmain211_d_run_mainUiPPaPUAAaZiZ6runAllMFZ9__lambda1MFNlZv + 39
11  sample-shooter-2d                   0x00000001000f3da3 scope void rt.dmain2._d_run_main(int, char**, extern (C) int function(char[][])*).tryExec(scope void delegate()) + 31
12  sample-shooter-2d                   0x00000001000f3e20 scope void rt.dmain2._d_run_main(int, char**, extern (C) int function(char[][])*).runAll() + 44
13  sample-shooter-2d                   0x00000001000f3da3 scope void rt.dmain2._d_run_main(int, char**, extern (C) int function(char[][])*).tryExec(scope void delegate()) + 31
14  sample-shooter-2d                   0x00000001000f3d16 _d_run_main + 458
15  sample-shooter-2d                   0x0000000100001801 main + 33
16  libdyld.dylib                       0x00007fffb4a3a234 start + 0
17  ???                                 0x0000000000000000 0x0 + 0
Process 1826 exited with status = 1 (0x00000001)
WebFreak001 commented 7 years ago

can you try to put a enforceGLErrors(); inside examples/shooter-2d/source/app.d in the run function after every line and see on which line it actually happens?

WebFreak001 commented 7 years ago

oh also try commenting out the glEnable(GL_LINE_SMOOTH);, glHint(GL_LINE_SMOOTH_HINT, GL_NICEST); and glPointSize(2); inside app.d

p0nce commented 7 years ago

Yes I'll try to debug it when I have the time.

p0nce commented 7 years ago

With an assert failing I'm not getting a stack trace or its messages for some reason (dmd). With lldb I get kind of lost.

WebFreak001 commented 7 years ago

doesn't enforceGLErrors print the stacktrace and line?