[.net] C# OpenGL BSP engine code

Started by
15 comments, last by cody 16 years, 9 months ago
It wont let me run it since I don't have the .NET framework 1.1, doesn't 2.0 have backwards compatability? I have the .NET 2.0 framework
Advertisement
The frameworks are meant to be installed side-by-side. 2.0 is not necessarily backwards compatible, but I believe the point releases (1.0, 1.1) must be.
hi, i couldnt compile.render system is error.

i include tao but Gl.glVertexPointer is false.it cant convert void to System.IntPtr.can you help me
Quote:Original post by cutler258
hi, i couldnt compile.render system is error.

i include tao but Gl.glVertexPointer is false.it cant convert void to System.IntPtr.can you help me


I don't understand your question, but tao's glVertexPointer binding is fine.

This suggestion is just a guess based on what you've written: try using "IntPtr.Zero". Notice also that there's an overload that accepts an object instead of an IntPtr. Try using that instead.

If that isn't helpfull, please try rephrasing the question more clearly and post the exact error.
Post the source code line that gives the error.

Was the Tao library included in your download, or did you use the version from the Tao site? There were quite quite a lot changes since this game was released, but should be easy to fix.
i am using tao 2.0

http://img470.imageshack.us/img470/7731/ekranmg6.jpg

i have this picture :(

i convert render system to csgl..

theese are codes:

--------------------------------------------------------

private unsafe void RenderPolygonFace(int FaceIndex)
{
BSPFace CurrentFace = Faces[FaceIndex];

if (Textures[CurrentFace.TextureID] != null)
{
//Vertices
fixed (void* VertexPtr = &Vertices[CurrentFace.StartVertexIndex * 3])
{
GL.glVertexPointer(3, Gl.GL_FLOAT, 0, VertexPtr);
}

if (CurrentFace.LightmapID >= 0)
{
if (Lightmaps[CurrentFace.LightmapID] != null)
{
//Lightmap
Gl.glBindTexture(Gl.GL_TEXTURE_2D,Lightmaps[CurrentFace.LightmapID].TextureID);

//Setup blending
GL.glDisable(Gl.GL_BLEND);
GL.glTexEnvi(Gl.GL_TEXTURE_ENV, Gl.GL_TEXTURE_ENV_MODE, Gl.GL_REPLACE);

//Set texture coordinates
fixed (void* LightmapCoordPtr = &LightmapCoords[CurrentFace.StartVertexIndex * 2])
{
GL.glTexCoordPointer(2, Gl.GL_FLOAT, 0, LightmapCoordPtr);
}

//Draw face
fixed (uint* IndexPtr = &MeshIndices[CurrentFace.MeshVertexIndex])
{
GL.glDrawElements(Gl.GL_TRIANGLES, CurrentFace.NumMeshVertices,
GL.GL_UNSIGNED_INT, IndexPtr);
}
}
}

//Decal texture
Gl.glBindTexture(Gl.GL_TEXTURE_2D, Textures[CurrentFace.TextureID].TextureID);

//Setup blending
GL.glEnable(Gl.GL_BLEND);
GL.glBlendFunc(Gl.GL_DST_COLOR, Gl.GL_SRC_COLOR);
GL.glTexEnvi(Gl.GL_TEXTURE_ENV, Gl.GL_TEXTURE_ENV_MODE, Gl.GL_REPLACE);

//Set texture coordinates
fixed (void* TexCoordPtr = &TextureCoords[CurrentFace.StartVertexIndex * 2])
{
GL.glTexCoordPointer(2, GL.GL_FLOAT, 0, TexCoordPtr);
}

//Draw face
fixed (uint* IndexPtr = &MeshIndices[CurrentFace.MeshVertexIndex])
{
GL.glDrawElements(GL.GL_TRIANGLES, CurrentFace.NumMeshVertices,
GL.GL_UNSIGNED_INT, IndexPtr);
}
}
}

-------------------------------------------------------------
Hm... I cant see whats wrong in the code, but csgl is extremely outdated. Tao is the way to go.

This topic is closed to new replies.

Advertisement