Started to play with hopengl. It's pretty cool :-) Very easy to use, quite cool :-)<br><br>Started to look at perf. What interests me most is to see how fast we can make vertex3f calls. Basically, we're testing the speed of the haskell/c boundary, where security(?) and marshalling are going to occur.
<br><br>Yes, we can send the vertices to a vertexarray and not have to handle vertex3f calls, but that's not what I want to measure ;-) <br><br>So, have a really rough and ready application that draws 45000 triangles a frame, then measures the framerate. Thats about 150,000 calls to vertex3f per frame.
<br><br>The application runs in Java, C#, and now Haskell.<br><br>Running in ghci, this runs at about 1.5 fps, really ballpark, havent checked I'm really drawing the number of triangles I think I'm drawing, or settings such as backface-culling or shademodel. That's not too bad.
<br><br>I'd like to compile to an executable to increase the framerate, but it's giving me the following output:<br><br>J:\dev\haskell>ghc -fglasgow-exts -O2 -o OglPerf.exe OglPerf.hs<br>OglPerf.o(.text+0x1f4):ghc3668_0.hc: undefined reference to `glutPostRedisplay@0
<br>'<br>OglPerf.o(.text+0x255):ghc3668_0.hc: undefined reference to `glVertex3f@12'<br>OglPerf.o(.text+0x1148):ghc3668_0.hc: undefined reference to `glViewport@16'<br>OglPerf.o(.text+0x1157):ghc3668_0.hc: undefined reference to `glMatrixMode@4'
<br>OglPerf.o(.text+0x115f):ghc3668_0.hc: undefined reference to `glLoadIdentity@0'<br>OglPerf.o(.text+0x11cc):ghc3668_0.hc: undefined reference to `glFrustum@48'<br>OglPerf.o(.text+0x11db):ghc3668_0.hc: undefined reference to `glMatrixMode@4'
<br>OglPerf.o(.text+0x11e3):ghc3668_0.hc: undefined reference to `glLoadIdentity@0'<br>OglPerf.o(.text+0x11fd):ghc3668_0.hc: undefined reference to `glTranslatef@12'<br>OglPerf.o(.text+0x1672):ghc3668_0.hc: undefined reference to `OpenGLzm2zi2zi1_Gr
<br>aphicsziRenderingziOpenGLziGLziVertexSpec_Vertex3_con_info'<br>OglPerf.o(.text+0x1764):ghc3668_0.hc: undefined reference to `OpenGLzm2zi2zi1_Gr<br>aphicsziRenderingziOpenGLziGLziVertexSpec_Vertex3_con_info'<br>
OglPerf.o(.text+0x1856):ghc3668_0.hc: undefined reference to `OpenGLzm2zi2zi1_Gr<br>aphicsziRenderingziOpenGLziGLziVertexSpec_Vertex3_con_info'<br>OglPerf.o(.text+0x1948):ghc3668_0.hc: undefined reference to `OpenGLzm2zi2zi1_Gr
<br>aphicsziRenderingziOpenGLziGLziVertexSpec_Vertex3_con_info'<br>OglPerf.o(.text+0x1b56):ghc3668_0.hc: undefined reference to `OpenGLzm2zi2zi1_Gr<br>aphicsziRenderingziOpenGLziGLziPrimitiveMode_Quads_closure'<br>
OglPerf.o(.text+0x1de9):ghc3668_0.hc: undefined reference to `OpenGLzm2zi2zi1_Gr<br>aphicsziRenderingziOpenGLziGLziFramebuffer_marshalClearBuffer_closure'<br>OglPerf.o(.text+0x1e00):ghc3668_0.hc: undefined reference to `OpenGLzm2zi2zi1_Gr
<br>aphicsziRenderingziOpenGLziGLziFramebuffer_sum_closure'<br>OglPerf.o(.text+0x1e42):ghc3668_0.hc: undefined reference to `OpenGLzm2zi2zi1_Gr<br>aphicsziRenderingziOpenGLziGLziFramebuffer_sum_closure'<br>[...]<br>
aphicsziRenderingziOpenGLziGLziStringQueries_Vendor_closure'<br>OglPerf.o(.text+0x340f):ghc3668_0.hc: undefined reference to `OpenGLzm2zi2zi1_Gr<br>aphicsziRenderingziOpenGLziGLziStringQueries_Renderer_closure'<br>
OglPerf.o(.text+0x3634):ghc3668_0.hc: undefined reference to `OpenGLzm2zi2zi1_Gr<br>aphicsziRenderingziOpenGLziGLziBasicTypes_Enabled_closure'<br>OglPerf.o(.text+0x3668):ghc3668_0.hc: undefined reference to `OpenGLzm2zi2zi1_Gr
<br>aphicsziRenderingziOpenGLziGLziCoordTrans_normalizze_closure'<br>OglPerf.o(.text+0x36c1):ghc3668_0.hc: undefined reference to `OpenGLzm2zi2zi1_Gr<br>aphicsziRenderingziOpenGLziGLziBasicTypes_Enabled_closure'<br>
OglPerf.o(.text+0x3716):ghc3668_0.hc: undefined reference to `OpenGLzm2zi2zi1_Gr<br>aphicsziRenderingziOpenGLziGLziBasicTypes_Enabled_closure'<br>OglPerf.o(.text+0x374a):ghc3668_0.hc: undefined reference to `OpenGLzm2zi2zi1_Gr
<br>aphicsziRenderingziOpenGLziGLziColors_lighting_closure'<br>[...]<br>collect2: ld returned 1 exit status<br><br>What am I missing?<br><br>