|
Product parts
|
|
Virtual File system
|
| Virtual Render |
| Virtual Machine |
| |
|
Demo Games
|
| |
|
3D Engine
|
|
gvSystem(dx9)
|
|
|
|
Link
|
 |
|
|
| |
Base Code.
|
|
| |
Application base code.
//
// cs sdk 1.13 base.
//
// cs sdk include
#include "../../include/CrossSuit.h"
/*
if u want using other header
#include "../../include/xxxxxx.h"
*/
int main(int argc, char* argv[])
{
// cross suit all initialize.
GV_SYSTEM::init_linux();
// update object...
// rendering...
}
// end ?
| |
| |
Display and Resolution Setting.
|
|
| |
Select Display Render.
defined all gm_grp_driver class.
gm_grp_driver* g_pgrpdriver=0x00;
//for using DX9 and win32 based systems. (ex) Common XP pc's and Hit Box 2(XP embeded)
g_pgrpdriver=new gm_grp_driver_dx9;
//for using hitbox3 linux based systems.
g_pgrpdriver=new gm_grp_driver_hb3;
// or using win32 based systems
g_pgrpdriver=new gm_grp_driver_soft
// or the other .. zenith linux board
g_pgrpdriver=new gm_grp_driver_znt;
// and then initialize.
g_pgrpdriver->init();
Resolution Setting.
default.cfg in app_tut/data
// if using dx9 and win32 renderer applied. other platform not applied.
set v_fullscreen "0"
// device width
set v_width "1024"
// device height
set v_height "768"
// coordinate width
set v_projection2d_width "1024"
// coordinate height
set v_projection2d_height "768"
// pivot coordinate
// 3.14/2 = "1.570"
set v_projection2d_rotate "0"
|
|
| |
Timer using
|
|
| |
Timer using it is simple.
defined all gvTimer_Win32 or gvTimer_LINUX class.
//
#include "../../CrossSuit.h"
/*
if u want using other header
#include "../../xxxxxx.h"
*/
int main(int argc, char* argv[])
{
// cross suit all initialize.
GV_SYSTEM::init_linux();
while(1)
{
//timer tick update.
GV_SYSTEM::TIMERUPDATE();
// example timer using code.
static float fdelayTime=0.0f;
fdelayTime+=Import.timer->frametime;
if(fdelayTime>1.0f ) // 1 second..
{
fdelayTime=0.0f; // reset value..?
// u'r code.
}
// update object...
// rendering...
}
}
// end ?
|
|
| |
Random value
|
|
| |
defined all gv_rand class.
gv_rand have own seed value.
gv_rand myrand;
myrand.srandmmm( /* if u want use patch value */);
// if u want 0.0 ~ 1.0f value.
float frand=myrand.user_rand2();
|
|
| |
2D Object (Texture load and rendering)
|
|
| |
defined all gv_OBJECT_RECT class.
gv_OBJECT_RECT testObject;
// prototype ..
// int AddRect(const char* szFileName, int x, int y, int w, int h, int iType, bool bcache=false);
testObject.AddRect("test.bmp",0,0,128,128,-1);
// if width -1 or height -1, it is setting test.bmp texture width. and also using height.
testObject.AddRect("test.bmp",0,0,-1,-1,-1);
// and update
testObject.Update();
// and rendering.
testObject.Render();
// Cross Suit SDK is using 24 bit image. internal framebuffer format is r5g6b5 or r5g5b5
|
|
| |
2D Object handling
|
|
| |
//now define class variable.
gv_OBJECT_RECT testObject;
// set position.
testObject.m_pRect->set_xy(x,y);
// show and hide.
testObject.SHOW(true /* or false */);
//blinking.
// prototype int SetBlinking(bool bblink, float fTimeShow, float fTimeHide, int nloop=-1);
// if u wanna 1.0f show and then 0.5f hiding. looping 3 times only.
testObject.SetBlinking(true/* or false */, 1.0f, 0.5f, 3 );
|
|
| |
2D Object Animation frame. using the ATX file.
|
|
| |
ATX file is animation frame information
//now define class variable.
gv_OBJECT_RECT testObject;
// prototype ..
// int AddRect(const char* szFileName, int x, int y, int w, int h, int iType, bool bcache=false);
testObject.AddRect("test.atx",0,0,-1,-1,-1);
// testObject.Update(); and testObject.Render();
// sample atx files are located in app_tut blow directory.
// ATX file format.
// frame speed.
fps 8
// alpha blend on/off
alpha_blend 1
//
texture_filename test.bmp
texture_filename xxx.bmp
// and testure_filename xxx.bmp more and more.~~~
// and now animation object.
// if param -1 infinite looping.
testObject.Loop( 10 /* u wanna looping count */ )
|
|
| |
2D Object Large Texture handling.
|
|
| |
|
|
| |
|
|
| |
|
|
| |
|
|
| |
|
|
| |
|
|
| |
|
|
| |
|
|
| |
|
|
| |
|
|
| |
|
|
| |
|
|
| |
|
|
| |
|
|
| |
|
|
|