VirtualMachine 3D Render Methods
[VirtualMachine Related Documentations]


Detailed Description

Nested classes and methods for graphic rendering with a VirtualMachine. This is thought as short as possible, but with enough features to support a classic 3D rendering state of the art: It has multiple layer for textures (InternalTexture::SetImageBitmap() ), and 3D object compilation if an object got a static shape. ( InternalObject3DBuffer::CompileAsStatic() ) It is also planned to support virtual screens and rectangle hierarchy with nested class InternalViewPort. You draw 3D objects with InternalViewPort::RenderMesh().


Classes

class  VirtualMachine::InternalVertex
 Nested class that defines a vertex for use with InternalObject3DBuffer::GetFirstVertex(). Note: this vertex definition should not change (no more member or virtual methods). It is sometimes used as a list element. More...
class  VirtualMachine::InternalTriangle
 Nested class that defines a Triangle Polygon for use with InternalObject3DBuffer::GetFirstTriangle(). Note: this triangle definition should not change (no more member or virtual methods).sizeof(InternalTriangle) must always be 12 because it is sometimes used as a list element. More...
class  VirtualMachine::InternalObject3DBuffer
 Nested class to define a 3D object as a vertex and a polygon list. You ask the creation of it with VirtualMachine::NewObject3DBuffer(), then defines its shape by filling the list you get with GetFirstVertex() and GetFirstTriangle(), then it can be rendered with RenderMesh(). In order to optimize a static shape, use CompileAsStatic() In edition mode, it can be destroyed with VirtualMachine::DeleteObject3DBuffer(). More...
class  VirtualMachine::InternalTexture
 Nested class that defines a texture to render an object with VirtualMachine::RenderMesh(). More...
class  VirtualMachine::InternalViewPort
 Nested class that defines a viewport where to draw (screen, sub-screen,texture rendering screens.) This is a virtual class. Construction must be done by NewViewPortChild(), NewViewPortOnTexture() or InitMachine() for the default viewport accessible with VirtualMachine::GetDefaultViewPort() which stands for the main screen. More...

Enumerations

enum  VirtualMachine::InternalObject3DBuffer_InitBit { VirtualMachine::bOb3D_VertexNormal = 1, VirtualMachine::bOb3D_VertexUVMapping = 2, VirtualMachine::bOb3D_VertexRGBA = 4 }
 see VirtualMachine::NewObject3DBuffer() More...

Functions

virtual void VirtualMachine::NewObject3DBuffer (InternalObject3DBuffer **_ppVertexAndPolygonBufferOut, unsigned int _maxNbVertex, unsigned int _maxNbTriangle, unsigned int _extraMemberFlags)=0
 Ask the Creation of a new InternalObject3DBuffer you can then fill with InternalObject3DBuffer::GetFirstVertex() , InternalObject3DBuffer::GetFirstTriangle(). Important: All the vertex members and polygon index are inited to zero when built. and InternalObject3DBuffer::SetNumberOfActiveTriangle() . Then the object can be positionned with the matrix methods in VirtualMachine::InternalViewPort, and drawn with VirtualMachine::InternalViewPort::RenderMesh(). The object shape can be dynamic and rebuilt, until a call to VirtualMachine::InternalObject3DBuffer::CompileAsStatic(). In edition compilation mode, objects had to be destroyed with VirtualMachine::DeleteObject3DBuffer().
virtual void VirtualMachine::DeleteObject3DBuffer (InternalObject3DBuffer **_ppBufferToDestroy)=0
 Destroy objects previously created with NewObject3DBuffer().
virtual void VirtualMachine::DeleteTexture (InternalTexture **_ppTextureToDestroy)=0
 Destroy objects previously created with NewTexture().
virtual void VirtualMachine::NewViewPortChild (InternalViewPort **_ppViewPortOut, InternalViewPort *_pFatherViewPort=0L)=0
 Ask the Creation of a new InternalViewPort, that must be the child of another ViewPort, specified by _pFatherViewPort.if no father is specified, the new ViewPort will be the child of the default root ViewPort. To create another Root ViewPort, create a texture and use VirtualMedia::NewViewPortOnTexture(). In edition mode, each InternalViewPort has to be destroyed with DeleteViewPort().
virtual void VirtualMachine::NewViewPortOnTexture (InternalViewPort **_ppViewPortOut, InternalTexture *_pRootTexture, unsigned int _np2PixelWidth, unsigned int _np2PixelHeight, InternalTexture::TextureImageLayerEnum _layerToAffect)=0
 Ask the Creation of a new Root InternalViewPort, that will render on a texture image. specified by _pRootTexture. You got to create a texture first for parameter _pRootTexture. In edition mode, each InternalViewPort has to be destroyed with DeleteViewPort().
virtual void VirtualMachine::DeleteViewPort (InternalViewPort **_ppViewPortToDestroy)=0
 Destroy any objects previously created with NewViewPortChild() or NewViewPortOnTexture(). If it has children, children are detached , not destoyed, but are invalid.
InternalViewPortVirtualMachine::GetDefaultViewPort ()
 Access to the default screen object created with InitMachine().


Enumeration Type Documentation

enum InternalObject3DBuffer_InitBit [inherited]
 

see VirtualMachine::NewObject3DBuffer()

Enumerator:
bOb3D_VertexNormal  Flag bit for NewObject3DBuffer(). Needed to enable InternalVertex::m_nx,m_ny,m_nz, for environment mapping and lightning.
bOb3D_VertexUVMapping  Flag bit for NewObject3DBuffer(). Needed to enable InternalVertex::m_u,m_v.
bOb3D_VertexRGBA  Flag bit for NewObject3DBuffer(). Needed to enable InternalVertex::m_ColorRGBA.

Definition at line 501 of file VirtualMachine.h.


Function Documentation

virtual void DeleteObject3DBuffer InternalObject3DBuffer **  _ppBufferToDestroy  )  [pure virtual, inherited]
 

Destroy objects previously created with NewObject3DBuffer().

Parameters:
_ppBufferToDestroy object to destroy, and set to 0L.

virtual void DeleteTexture InternalTexture **  _ppTextureToDestroy  )  [pure virtual, inherited]
 

Destroy objects previously created with NewTexture().

Parameters:
_ppTextureToDestroy object to destroy, and set to 0L.

virtual void DeleteViewPort InternalViewPort **  _ppViewPortToDestroy  )  [pure virtual, inherited]
 

Destroy any objects previously created with NewViewPortChild() or NewViewPortOnTexture(). If it has children, children are detached , not destoyed, but are invalid.

Parameters:
_ppViewPortToDestroy pointer to object to destroy, and set to 0L.

InternalViewPort* GetDefaultViewPort  )  [inline, inherited]
 

Access to the default screen object created with InitMachine().

Returns:
the Viewport that stands for the whole screen, or NULL if not opened.

Definition at line 593 of file VirtualMachine.h.

References VirtualMachine::m_pDefaultViewPort.

virtual void NewObject3DBuffer InternalObject3DBuffer **  _ppVertexAndPolygonBufferOut,
unsigned int  _maxNbVertex,
unsigned int  _maxNbTriangle,
unsigned int  _extraMemberFlags
[pure virtual, inherited]
 

Ask the Creation of a new InternalObject3DBuffer you can then fill with InternalObject3DBuffer::GetFirstVertex() , InternalObject3DBuffer::GetFirstTriangle(). Important: All the vertex members and polygon index are inited to zero when built. and InternalObject3DBuffer::SetNumberOfActiveTriangle() . Then the object can be positionned with the matrix methods in VirtualMachine::InternalViewPort, and drawn with VirtualMachine::InternalViewPort::RenderMesh(). The object shape can be dynamic and rebuilt, until a call to VirtualMachine::InternalObject3DBuffer::CompileAsStatic(). In edition compilation mode, objects had to be destroyed with VirtualMachine::DeleteObject3DBuffer().

Parameters:
_ppVertexAndPolygonBufferOut the object returned, or 0L if failed.(no mem ?)
_maxNbVertex maximum number of vertex to fill.
_maxNbTriangle maximum number of Triangle to fill.
_extraMemberFlags or'ed bits (bOb3D_...) to activate extra vertex members.

virtual void NewViewPortChild InternalViewPort **  _ppViewPortOut,
InternalViewPort _pFatherViewPort = 0L
[pure virtual, inherited]
 

Ask the Creation of a new InternalViewPort, that must be the child of another ViewPort, specified by _pFatherViewPort.if no father is specified, the new ViewPort will be the child of the default root ViewPort. To create another Root ViewPort, create a texture and use VirtualMedia::NewViewPortOnTexture(). In edition mode, each InternalViewPort has to be destroyed with DeleteViewPort().

Parameters:
_ppViewPortOut the object returned, or 0L if failed.(no mem ?)
_pFatherViewPort the father viewport. If 0L, it uses the default root.

virtual void NewViewPortOnTexture InternalViewPort **  _ppViewPortOut,
InternalTexture _pRootTexture,
unsigned int  _np2PixelWidth,
unsigned int  _np2PixelHeight,
InternalTexture::TextureImageLayerEnum  _layerToAffect
[pure virtual, inherited]
 

Ask the Creation of a new Root InternalViewPort, that will render on a texture image. specified by _pRootTexture. You got to create a texture first for parameter _pRootTexture. In edition mode, each InternalViewPort has to be destroyed with DeleteViewPort().

Parameters:
_ppViewPortOut the object returned, or 0L if failed.(no mem ?)
_pRootTexture an InternalTexture. Can't be null.
_np2PixelWidth integer which can be 1,2,4,8,16,32,64,128,256,512 that stand for the square of the pixel width.
_np2PixelHeight integer which can be 1,2,4,8,16,32,64,128,256,512 that stand for the square of the pixel height.
_layerToAffect the texture layer (simple mapping, environment) where to render.


      /\/\        4         N         k         !         N         D
                      _______  _ __ ___  _____            ___ _ _  ____
     ___________  __//___   /________  |/    / ___________\_______/    \
    /   _   _   \/   _     /    _   /      _/_/____/    _       __     /
   /    /   /       /     /    /    \      \/     /    /    \   \     /
  \\___/___/___/    ¯    _____/_____/       ______\___/_____/\________\\
               \________/_ ___ __ l____\      /elD!  
                 http://www.m4nkind.com \____/