Hm still nothing. That's how the whole code is looking like:
Code:
/******************************************************************************/
#include "stdafx.h"
/******************************************************************************/
Mesh mesh;
Vtx3DSimple _A, _B, _C, _D;
/******************************************************************************/
void InitPre()
{
App.name("Rendering");
App.flag=APP_MS_EXCLUSIVE;
Paks.add("../data/engine.pak");
}
/******************************************************************************/
Bool Init()
{
Cam.dist=2;
mesh.create(1).base(0).create(Ball(1),VTX_TEX0|VTX_NRM|VTX_TNG); // create Mesh with 1 MeshPart, and create this MeshPart's base from Ball with automatic texture coordinates, normals and tangents
mesh.setMaterial(Materials("../data/mtrl/brick/0.mtrl")).setRender().setBox(); // set mesh material, rendering version and bounding box
_A.pos = Vec(-0.5, 0, -0.5);
_B.pos = Vec(0.5, 0, -0.5);
_C.pos = Vec(0.5, 0, 0.5);
_D.pos = Vec(-0.5, 0, 0.5);
_A.tex = Vec2(0,0);
_B.tex = Vec2(0,1);
_C.tex = Vec2(1,1);
_D.tex = Vec2(1,0);
_A.nrm = Vec(0,1,0);
_B.nrm = Vec(0,1,0);
_C.nrm = Vec(0,1,0);
_D.nrm = Vec(0,1,0);
return true;
}
/******************************************************************************/
void Shut()
{
}
/******************************************************************************/
Bool Update()
{
if(Kb.bp(KB_ESC))return false;
CamHandle(1.5,10,CAMH_ZOOM|CAMH_ROT);
return true;
}
/******************************************************************************/
void Render() // Rendering Function
{
switch(Renderer()) // Rendering Function will be called multiple times for different Rendering Modes
{
// the most important is the "prepare" mode in which you should draw all the meshes and add lights
case RM_PREPARE:
{
// add directional light
LightDir(Vec(0,0,1)).add();
}break;
}
}
void Draw()
{
//D.clear(WHITE);
Renderer(Render); // render with 'Render' function
SetMatrix();
VI.image(Images("../data/logo+alpha.gfx"));
VI.face(_A,_B,_C,_D);
VI.end();
D.text(0,0.9,S+"Fps: "+Time.fps()); // show number of fps
}
/******************************************************************************/
Maybe ther's something else wrong with It ? (I just edited the first rendering tutorial)