Menu

Tree [r3] /
 History

HTTPS access


File Date Author Commit
 Input 2007-06-12 geirgrusom [r1]
 OpenGL 2007-06-12 geirgrusom [r1]
 Properties 2007-06-12 geirgrusom [r1]
 bin 2007-06-12 geirgrusom [r1]
 obj 2007-06-12 geirgrusom [r1]
 Buffer.cs 2007-06-12 geirgrusom [r1]
 DisplayObject.cs 2007-06-12 geirgrusom [r1]
 Font.cs 2007-06-12 geirgrusom [r1]
 Frustum.cs 2007-06-12 geirgrusom [r1]
 Glorg.csproj 2007-06-12 geirgrusom [r1]
 GlorgBase.cs 2007-06-12 geirgrusom [r1]
 GlorgDiagram.cd 2007-06-12 geirgrusom [r1]
 Input.zip 2007-06-12 geirgrusom [r1]
 Light.cs 2007-06-12 geirgrusom [r1]
 Load3ds.cs 2007-06-12 geirgrusom [r1]
 Matrix.cs 2007-06-12 geirgrusom [r1]
 Mesh.cs 2007-06-12 geirgrusom [r1]
 MeshBuilder.cs 2007-06-12 geirgrusom [r1]
 ModelMatrix.cs 2007-06-12 geirgrusom [r1]
 Octree.cs 2007-06-12 geirgrusom [r1]
 OggVorbis.cs 2007-06-12 geirgrusom [r1]
 OpenALDevice.cs 2007-06-12 geirgrusom [r1]
 OpenGLControl.cs 2007-06-12 geirgrusom [r1]
 OpenGLDevice.cs 2007-06-12 geirgrusom [r1]
 OpenGLUtility.cs 2007-06-12 geirgrusom [r1]
 Pipe.cs 2007-06-12 geirgrusom [r1]
 ProceduralTexture.cs 2007-06-12 geirgrusom [r1]
 Shader.cs 2007-06-12 geirgrusom [r1]
 Texture.cs 2007-06-12 geirgrusom [r1]
 Vertex.cs 2007-06-12 geirgrusom [r1]
 VertexBuffer.cs 2007-06-12 geirgrusom [r1]
 WaveFile.cs 2007-06-12 geirgrusom [r1]
 glorg release 1.zip 2007-06-12 geirgrusom [r2]
 glorg.zip 2007-06-20 geirgrusom [r3]
 openal.cs 2007-06-12 geirgrusom [r1]
 pterrain.cs 2007-06-12 geirgrusom [r1]
 readme.txt 2007-06-12 geirgrusom [r1]
 source.zip 2007-06-20 geirgrusom [r3]

Read Me

Glorg Software Development Kit

0.2 beta

General information:

Glorg is a Graphics Development Kit for .NET languages,
it uses an interface written entirely in C#, it supports generic vertex buffers and index buffers (Glorg.Generic namespace)
wich is kinda how this works in Direct3D, although in most cases, use SimpleMesh, since GenerateNormals is defined there. 

Generic vertex buffer
To define a generic vertex buffer, create a new instance of Glorg.Generic.DescribedVertexBuffer
T is the datatype of  your preferred vertex structure.
This must contain one Vertex position type, everything else, is optional.
The constructor requires one parameter, and this is the structure description, usually, I define this as a static property named Description in each Vertex structure.
This is an array of Glorg.Descriptor Enum.
Each item in the array, defines one type of data, of one of these kinds:
Vertex (position data), Normal, TexCoord, Color, Weight or Null (this is for unused data)
The enum Type is used to retrieve vertex type.
Each of these can have several different datatype sizes:
Byte, Word, Dword or Qword, these define the size (8, 16, 32 and 64-bit)
And of course, the datatype, the supported types are:
Integer and Float
So to create e.g. a Double, simply add [Descriptor] |= Glorg.Descriptor.Qword | Glorg.Descriptor.Float
After that, we need to determine how many of these are in this type, there can be a maximum of 255, but no types accept this number
And then, some formats can have mutiple elements, and to enumerate these, First, Second, Thrid and Fourth can be used (for e.g. multitexturing)
This is defined as First, Second, Third and Fourth, you can have more, this is the last byte in the descriptor, so either define it by hex, or bitshifting 24 bit to the left.

So the most standard vertex format, 3 float, 3 normal and 2 texture coordinates, would be defined as follows:
Descriptor[] Description = new Descriptor[]  {
	Descriptor.Vertex | Descriptor.Float | Descriptor.Dword | Descriptor.Three, 
	Descriptor.Normal | Descriptor.Float | Descriptor.Dword | Descriptor.Three,
	Descriptor.TexCoord | Descriptor.Float | Descriptor.Dword | Descriptor.Two | Descriptor.First
	}
This vertex format is already defined as Glorg.VertexNormalTex.

How to use:

To create an OpenGL device window, either use Glorg.OpenGLDevice directly yourself, or place OpenGLDeviceControl on your form, this contains the OpenGL
device (Device)

And that's it! you have with or without success, created you OpenGL device, now we are ready to draw.
To initiate a scene, class OpenGLDevice.SceneInit(), and OpenGLDevice.SceneEnd()
Init will initialize the scene (clearing color and depth buffer) and SceneEnd() will flush the device, and draw to the device context using OpenGL.NativeOpenGL.SwapBuffers()
Between these, is the place we should draw.
It can be done directly, with meshes and all, but the easiest way, is to use Glorg.NodeTree.
This is a tree used to define the scene, each node has special properties, but most importantly, we need to use Glorg.NodeTree.ProjectionMatrix.
The class is used to setup the viewport matrix, use Glorg.NodeTree.ProjectionMatrix.Matrix.Perspective if you want a perspective.
You can use this as your parent node, but maybe you want other things to happen first (drawing a background or something) so I always set the parent
node as a Glorg.NodeTree.Node.
All the child nodes of ProjectionMatrix will be affected by this matrix, same with ModelMatrix and TextureMatrix.
You may want to draw something here, therefore you can add ActiveObject, wich is nodes that can be either subclassed, or bound to Events (OnFrameTick etc)
To assign a mesh to an ActiveObject, simply use Glorg.NodeTree.IO.NodeTree3ds,
To draw the scene, call Node.Process([Device])
this will both load textures that are defined by the 3ds file, load models, create normals, and in the future, much much more.
Setting Environment to True on a mesh, will define that OpenGL should generate the txeture coordinates using GL_SPHERE_MAP
Ok, now you should know all you need to get started.
There is a class named procedural texture, it functions, but not properly implemented.

Everything omitted, can be manually implemented by OpenGL.NativeOpenGL, there is also a namespace named OpenAL.

To be continued:
Ogg Vorbis is planned to be implemented.
Camera class would make a lot of things easier
A full IDE Map Editor to create games is in the making (although, now you can only create Dlls and exe with subclasses of already defined classes)
More MeshBuilders (only CylinderBuilder is working... it think)
More model formats
loading dds maybe?
Octree, and Quadtree
Functional terrain class
Wave files arent streamed, they are loaded fully into memory, but streaming is supported by the base class.
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.