Xiphias Engine Testing

Community Forums/Showcase/Xiphias Engine Testing

N(Posted 2005) [#1]
What I'd like to ask people to do is try to actually use Xiphias. Yep, scary proposition ;)

I just finished writing the 'minor' (as in not completely done but it'll suffice) docs for the engine and I want to see how the hold up.

Now, if you've ever used Axiom or Ogre, I'm hoping that Xiphias will be fairly familiar interface-wise.

But anyways, click the Xiphias link in my signature and that'll bring you to the release page. Get today's release (6-9-05, uses the US date format). I'll eventually add a button that points to the latest version, but 'til then this'll suffice.

To install the module, you copy cower.mod to your BlitzMax/mod folder, then go into a terminal or command prompt (different names depending on the OS you're using), cd to your Blitzmax/bin folder, and type the following:

bmk makemods cower
bmk syncdocs

And you should then be able to import Cower.GraphicsDev and Cower.GlDev (and Cower.Xml and Cower.CUtil if you so wish, but they're just included because of dependencies).

To create a GL graphics device, you do something along the lines of the following:
Local device:GfxDevice = New GlGfxDevice

Local gfxMode:GraphicsMode = New GraphicsMode
'' Change width or height of the graphics mode, default will do though

'' Reset the graphics device now
device.Reset( gfxMode ) ' This'll set up the defaults and all that stuff, then you get to mess around with the rest of the stuff


Everything else should be accessible through the Cower.GraphicsDev interface (you shouldn't have to ever actually interact with an API-specific module except to create a new instance of a device object).

Anyhow, have fun trying to blow up your PC with it. (If that really happens I'll be amazed)

By the way, because the OpenGL module still hasn't been fixed, you have to change glGetString in pub.opengl to return a Byte Ptr.


GfK(Posted 2005) [#2]
I don't like Xiphias. I don't like any sort of willy disease.


Robert(Posted 2005) [#3]
Are there any examples around? I couldn't see any in the zip file.


N(Posted 2005) [#4]
No. If you need an example of something in specific, ask me and I'll post one (if it's something that isn't likely to change).


Perturbatio(Posted 2005) [#5]
I get identifier TextureModes not found (texturemanager.bmx, line 45) with the 6-9-05 version


Perturbatio(Posted 2005) [#6]
on doing a full rebuild, I also get Expecting identifier but encountered Default in textures.bmx at line 65
	Global Default = TextureModes.Mipmaps



N(Posted 2005) [#7]
Builds fine here...


Perturbatio(Posted 2005) [#8]
changing Default to DefaultMode allows it to compile the modules properly.
Strange that it compiles for you (have you disabled quick build?) since Default is a reserved keyword.


N(Posted 2005) [#9]
Reuploaded with a 'fix' I forgot to amend to the uploaded version (that I made shortly after uploading).


TroM(Posted 2005) [#10]
"I don't like Xiphias. I don't like any sort of willy disease."

lol, yeah stay away!


Robert(Posted 2005) [#11]
No. If you need an example of something in specific, ask me and I'll post one (if it's something that isn't likely to change).


An example showing how to load a mesh and a texture and render the entity on screen would be useful, just to help me get started.


N(Posted 2005) [#12]
An example showing how to load a mesh and a texture and render the entity on screen would be useful, just to help me get started.


Xiphias does not handle loading meshes and has absolutely no entity code (nor will it ever have an entity management). It's a rendering engine, not a game engine.

All it's designed to do is to provide an interface between the programmer and graphics API, this being anything your heart desires as long as there's an implementation written for it (at the moment, GL and Direct3D 9 are being worked on).

So, to load a mesh you'd have to load it and create a vertex format for it, then load all the vertex data, and create a VertexBuffer from it:
Type Vertex_PCT Extends IVertex
  Field X#, Y#, Z#, R@, G@, B@, A@, U#, V#

  Method PositionPtr:Byte Ptr( )
    Return Varptr X
  End Method

  Method ColorPtr:Byte Ptr( )
    Return Varptr R
  End Method

  Method TexCoordPtr:Byte Ptr( )
    Return Varptr U
  End Method
End Type

Local format:VertexFormat = New VertexFormat
format.AddFormat( VertexFormat.Position3f )
format.AddFormat( VertexFormat.Color4ub )
format.AddFormat( VertexFormat.TexCoord2f )

Local vdata:VertexData = New VertexData
vdata.Format = format.Copy( )

.. Add vertices ..
e.g., vdata.AddVertex( New Vertex_PCT )
.. Done adding vertices ..

Local vbuffer:VertexBuffer = CreateVertexBuffer( vdata ); Assert vbuffer,"Failed to create vertex buffer"


Loading a texture:
Local t:Texture = TextureManager.Instance( ).FromURL( "texture.ext", TextureTypes.TwoD, TextureModes.Mipmaps )


Rendering the stuff..
Local op:RenderOp = New RenderOp
op.vb = vbuffer

device.SetTextureUnit( 0 )
device.SetTexture( t )
device.Render( op )


That would usually be between these..
While Not KeyHit( KEY_ESCAPE )
  device.Clear( )
  
  .. Your code here
  
  device.Present( Null ) ' Null because you're not specifying any render targets
Wend


That's the simple way. I haven't written the code for setting the blending operations for texture units yet, so don't try to do that.