Home

Resume

Blog

Teikitu


/* =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= */
/*  »Project«   Teikitu Gaming System (TgS) (∂)
    »File«      TgS Render.h
    »Author«    Andrew Aye (EMail: mailto:andrew.aye@gmail.com, Web: http://www.andrewaye.com)
    »Version«   4.51 / »GUID« A9981407-3EC9-42AF-8B6F-8BE6DD919615                                                                                                        */
/*   -------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
/*  Copyright: © 2002-2017, Andrew Aye.  All Rights Reserved.
    This software is free for non-commercial use.  Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
      following conditions are met:
        Redistribution of source code must retain this copyright notice, this list of conditions and the following disclaimers.
        Redistribution in binary form must reproduce this copyright notice, this list of conditions and the following disclaimers in the documentation and other materials
          provided with the distribution.
    The name of the author may not be used to endorse or promote products derived from this software without specific prior written permission.
    The intellectual property rights of the algorithms used reside with Andrew Aye.
    You may not use this software, in whole or in part, in support of any commercial product without the express written consent of the author.
    There is no warranty or other guarantee of fitness of this software for any purpose. It is provided solely "as is".                                                   */
/* =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= */
#if !defined(_TGS_RENDER_H_)
#define _TGS_RENDER_H_
#pragma once

#if !defined(_TGS_PLATFORM_RENDER_H_)
#error This file should not be included directly - use the correct platform include wrapper
#endif

#include "TgS RENDER/TgS Render - Constants.h"
#include "TgS RENDER/TgS Render - Type.h"
#include "TgS RENDER/TgS Render - Data.h"


/* == Render ============================================================================================================================================================ */

/* -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-. */
/*  Module Functions                                                                                                                                                      */
/* -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-. */

TgEXTN TgRESULT                             tgRN_Init_Module( TgVOID ); /* #TODO: Implement */
TgEXTN TgRESULT                             tgRN_Boot_Module( TgVOID ); /* #TODO: Implement */
TgEXTN TgRESULT                             tgRN_Update_Module( C_TgFLOAT32 );  /* #TODO: Implement */ /* Client Only */
TgEXTN TgVOID                               tgRN_Stop_Module( TgVOID ); /* #TODO: Implement */
TgEXTN TgVOID                               tgRN_Free_Module( TgVOID ); /* #TODO: Implement */

TgEXTN TgRESULT                             tgRN_Load_Config( TgVOID ); /* #TODO: Implement */
TgEXTN TgRESULT                             tgRN_Save_Config( TgVOID ); /* #TODO: Implement */

TgEXTN TgBOOL                               tgRN_Query_Init( TgVOID ); /* #TODO: Implement */
TgEXTN TgBOOL                               tgRN_Query_Boot( TgVOID ); /* #TODO: Implement */
TgEXTN TgSIZE                               tgRN_Query_Fixed_Memory( TgVOID ); /* #TODO: Implement */


/* -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-. */
/*  Render Functions                                                                                                                                                      */
/* -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-. */

/* -- Resource - Material ----------------------------------------------------------------------------------------------------------------------------------------------- */

                                            /* Load Material - Create a new material with the given data. Return an instance if the unique name is found in the library.  */
                                            /* The allocator type will be used for initialization of any texture resources required by the material. However, materials   */
                                            /* are all stored in system memory in as part of the global reservation of the render system. */
                                            /* 1: Allocator - Memory allocation method used for the resource */
                                            /* 2: Name Hash - Hash of the unique name (key) for this resource */
                                            /* 3: Input Stream - The data stream representing the resource */
                                            /* 4: Call Back: The function (if defined) is called when loading is complete */
                                            /* 5: Call Back Parameter: Extra parameter passed to the call back */
TgEXTN TgRN_MATERIAL_ID                     tgRN_Load_Material( C_ETgKN_GPU_ALLOCATOR, C_TgUINT32, PC_STg2_Input, C_TgUINTPTR, TgVOID(*)(C_TgUINTPTR, C_TgRN_MATERIAL_ID) ); /* #TODO: Implement */

                                            /* Instance_Material - Return a new material id for the given parameter. If a resource is found in the library, the reference */
                                            /* count will be increased and a new material id will be reserved. If the resource is not found, then the invalid material id */
                                            /* is returned.  If the material has no matching input layout for the vertex type the invalid material is returned. */
                                            /* 1: Material ID - Source material id */
                                            /* 2: Vertex Type - The vertex stream type to be used with the material */
TgEXTN TgRN_MATERIAL_ID                     tgRN_Instance_Material( C_TgRN_MATERIAL_ID, C_ETgRN_VERTEX ); /* #TODO: Implement */

TgEXTN TgVOID                               tgRN_Release_Material( C_TgRN_MATERIAL_ID ); /* #TODO: Implement */

                                            /* 1: UV0, UV1 [Out] - Offsets for a possible two set of UVs */
                                            /* 2: UV Stride [Out] - Stride of the UV */
                                            /* 3: Material ID - Material to be used for the calculation */
                                            /* 4: Time Step - Time increase since the last calculation */
                                            /* 5: Total Time - Total time executing the animation */
TgEXTN TgVOID                               tgRN_F_Calc_UV_Animation( PCU_TgVEC_F32_04, PCU_TgFLOAT32, C_TgRN_MATERIAL_ID, C_TgFLOAT32, C_TgFLOAT32 ); /* #TODO: Implement */
TgEXTN TgVOID                               tgRN_M_Calc_UV_Animation( PCU_TgVEC_M_F32_04, PCU_TgVEC_M_F32_04, C_TgRN_MATERIAL_ID, TgVEC_M_F32_04, TgVEC_M_F32_04 ); /* #TODO: Implement */

/* -- Resource - Mesh Set ----------------------------------------------------------------------------------------------------------------------------------------------- */

                                            /* Load Mesh - Create a new mesh id with the given data.  Return an instance if the unique name is found in the library. */
                                            /* 1: Allocator - Memory allocation method used for the resource */
                                            /* 2: Name Hash - Hash of the unique name (key) for this resource */
                                            /* 3: Input Stream - The data stream representing the resource */
                                            /* 4: Call Back: The function (if defined) is called when loading is complete */
                                            /* 5: Call Back Parameter: Extra parameter passed to the call back */
TgEXTN TgRN_MESH_SET_ID                     tgRN_Load_Mesh_Set( C_ETgKN_GPU_ALLOCATOR, C_TgUINT32, PC_STg2_Input, C_TgUINTPTR, TgVOID(*)(C_TgUINTPTR, C_TgRN_MESH_SET_ID) ); /* #TODO: Implement */


                                            /* Instance_Mesh - Return a new mesh id for the given parameter. If the resource is found in the library, the reference count */
                                            /* will be increased and a new mesh id will be reserved.  If the resource is not found, then the invalid mesh id is returned. */
                                            /* 1: Mesh ID - Source mesh id */
TgEXTN TgRN_MESH_SET_ID                     tgRN_Instance_Mesh_Set( C_TgRN_MESH_SET_ID ); /* #TODO: Implement */

TgEXTN TgVOID                               tgRN_Release_Mesh_Set( C_TgRN_MESH_SET_ID ); /* #TODO: Implement */


#if TgCOMPILE_RENDER_DEBUG_OUTPUT
/* -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-. */
/*  Debug Interface                                                                                                                                                       */
/* -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-. */

                                            /* Batch_Line - Attempt to batch the line render together by line type */
                                            /* 1: Vertex 1 - Vertex one of the line */
                                            /* 2: Colour 1 - Colour of vertex one */
                                            /* 3: Vertex 2 - Vertex two of the line */
                                            /* 4: Colour 2 - Colour of vertex two */
TgEXTN TgVOID                               tgRN_DBG_Line( TgVEC_M_F32_04, C_TgCOLOUR32, TgVEC_M_F32_04, C_TgCOLOUR32 );

                                            /* Draw Axes */
                                            /* 1: Reference Frame */
                                            /* 2: Scale */
TgEXTN TgVOID                               tgRN_DBG_Axes( CPCU_TgMAT_F32_34, C_TgFLOAT32 );

                                            /* Draw nGon */
                                            /* 1: Colour */
                                            /* 2: Reference Frame */
                                            /* 3: Number of Sides */
TgEXTN TgVOID                               tgRN_DBG_nGon( C_TgCOLOUR32, CPCU_TgMAT_F32_34, C_TgFLOAT32, C_TgSINT32 );

                                            /* Draw Frustum */
                                            /* 1: Colour */
                                            /* 2: Camera / Camera Projection Matrix */
                                            /* 3: Camera View Matrix */
                                            /* 4: Camera Inverse Projection Matrix */
                                            /* 5: Camera Inverse View Matrix */
TgEXTN TgVOID                               tgRN_DBG_Frustum( C_TgCOLOUR32, CPCU_TgMAT_F32_44, CPCU_TgMAT_F32_44, CPCU_TgMAT_F32_44, CPCU_TgMAT_F32_44 );
TgEXTN TgVOID                               tgRN_DBG_Frustum_Camera( C_TgCOLOUR32, CPCU_STg2_RN_Cxt_Camera );

                                            /* Draw Primitive */
                                            /* 1: Colour */
                                            /* 2: Reference Frame */
                                            /* 3: Primitive Constants - Radii, Extents */
TgEXTN TgVOID                               tgRN_DBG_Capsule( C_TgCOLOUR32, CPCU_TgMAT_F32_34, C_TgFLOAT32, C_TgFLOAT32 );
TgEXTN TgVOID                               tgRN_DBG_Cone( C_TgCOLOUR32, CPCU_TgMAT_F32_34, C_TgFLOAT32, C_TgFLOAT32 );
TgEXTN TgVOID                               tgRN_DBG_Cylinder( C_TgCOLOUR32, CPCU_TgMAT_F32_34, C_TgFLOAT32, C_TgFLOAT32 );
TgEXTN TgVOID                               tgRN_DBG_Sphere( C_TgCOLOUR32, TgVEC_M_F32_04, C_TgFLOAT32 );
TgEXTN TgVOID                               tgRN_DBG_Tube( C_TgCOLOUR32, CPCU_TgMAT_F32_34, C_TgFLOAT32, C_TgFLOAT32 );
TgEXTN TgVOID                               tgRN_DBG_Box( C_TgCOLOUR32, CPCU_TgMAT_F32_34, TgVEC_M_F32_04 );
TgEXTN TgVOID                               tgRN_DBG_Tetrahedron( C_TgCOLOUR32, CPCU_TgMAT_F32_34, C_TgFLOAT32 );
TgEXTN TgVOID                               tgRN_DBG_Wireframe_Box( C_TgCOLOUR32, CPCU_TgMAT_F32_34, TgVEC_M_F32_04 );
TgEXTN TgVOID                               tgRN_DBG_Wireframe_Tetrahedron( C_TgCOLOUR32, CPCU_TgMAT_F32_34, C_TgFLOAT32 );

                                            /* Draw Primitive */
                                            /* 1: Colour */
                                            /* 2: Primitive */
TgEXTN TgVOID                               tgRN_DBG_Geom_Capsule( C_TgCOLOUR32, CPCU_TgTUBE_F32_04 );
TgEXTN TgVOID                               tgRN_DBG_Geom_Cylinder( C_TgCOLOUR32, CPCU_TgTUBE_F32_04 );
TgEXTN TgVOID                               tgRN_DBG_Geom_Sphere( C_TgCOLOUR32, CPCU_TgSPHERE_F32_04 );
TgEXTN TgVOID                               tgRN_DBG_Geom_Tube( C_TgCOLOUR32, CPCU_TgTUBE_F32_04 );
TgEXTN TgVOID                               tgRN_DBG_Geom_Box( C_TgCOLOUR32, CPCU_TgBOX_F32_04 );
TgEXTN TgVOID                               tgRN_DBG_Geom_BoxAA( C_TgCOLOUR32, CPCU_TgBOXAA_F32_04 );
TgEXTN TgVOID                               tgRN_DBG_Geom_Wireframe_Box( C_TgCOLOUR32, CPCU_TgBOX_F32_04 );
TgEXTN TgVOID                               tgRN_DBG_Geom_Wireframe_BoxAA( C_TgCOLOUR32, CPCU_TgBOXAA_F32_04 );

                                            /* Draw Axis Aligned Box */
                                            /* 1: Colour */
                                            /* 2: Min Point */
                                            /* 3: Max Point */
TgEXTN TgVOID                               tgRN_DBG_BoxAA( C_TgCOLOUR32, TgVEC_M_F32_04, TgVEC_M_F32_04 );
TgEXTN TgVOID                               tgRN_DBG_Wireframe_BoxAA( C_TgCOLOUR32, TgVEC_M_F32_04, TgVEC_M_F32_04 );

                                            /* Draw_Text(F) - Buffer a debug text call for this frame */
                                            /* 1: [In/Out] X Pixel Position */
                                            /* 2: [In/Out] Y Pixel Position */
                                            /* 3: Text Colour */
                                            /* 4: Text String */
                                            /* 5: VarArg Parameters */
TgEXTN TgVOID                               tgRN_DBG_Text( PCU_TgSINT32, PCU_TgSINT32, C_TgCOLOUR32, CPCU_TgCHAR );
TgEXTN TgVOID                               tgRN_DBG_TextF( PCU_TgSINT32, PCU_TgSINT32, C_TgCOLOUR32, CPCU_TgCHAR, ... );

                                            /* Draw_Text(F) - Buffer a debug text call for this frame */
                                            /* 1: Text Header */
                                            /* 2: Text String */
                                            /* 3: VarArg Parameters */
TgEXTN TgVOID                               tgRN_DBG_Text_With_Header( PCU_STg2_RN_Text_Header, CPCU_TgCHAR );
TgEXTN TgVOID                               tgRN_DBG_TextF_With_Header( PCU_STg2_RN_Text_Header, CPCU_TgCHAR, ... );

/*# TgCOMPILE_RENDER_DEBUG_OUTPUT */
#endif

/* ====================================================================================================================================================================== */
#endif