
SGI compatible version?
Posted Wednesday, 27 June, 2012 - 13:26 by yunharla inHi guys,
I recently started porting some of my GL helpers to VC++ (adding ifdefs for .net compilers...), so i can write code for all the different IDEs without rewriting huge chunks. By doing so i
realised that the OpenTK version im using incompatible with the SGI headers, so i was wondering if and which version could help here? i mean, if there aint one i have to translate the whole
header to opentk code....


Comments
Re: SGI compatible version?
Maybe the Compatibility.Tao namespace is what you're looking for?
Re: SGI compatible version?
well you see the problem is that neither TAO nor OpenTK seem to work correctly with c++.
For example i use the following code i just get some random junk
but when i use a c# callback that converts the pixels pointer to a byte[] and then calls Gl.TexImage2D every works....
not to mention that some function that take floats as arguments take doubles....
and since the code is a 1:1 of android and ios i must assume that something is definitly wrong here....
Re: SGI compatible version?
some function that take floats as arguments take doubles
If you really should find anything like that, please be make a bug report.
You cannot port C++ code directly to C#, the garbage collector must be considered.
1. One important factor here is that memory allocated in C++ will remain at it's position until deleted, and the code you are porting very likely relies on that. Unless you use the fixed statement or GCHandle & Co. the garbage collector in .Net may compact memory alignment or delete any object that isn't referenced anymore.
2. The OpenGL commands issued by the CPU are queued first and later processed by the GPU at a different pace. This means code like this may work 99 times but fail the 100th with an Access Violation.
...because the garbage collector was faster than GL.Foo.
3. On topic Vertex Arrays, please read http://www.opentk.com/doc/graphics/geometry/vertex-arrays