Xors3d Engine
Hello 3D World
Before creating your first project make sure you have properly installed Xors3d (Installation).
Let's make a small application in which a camera, a light source and a rotating cube will be created. An application can be closed by pressing Esc key or Close window button.

Blitz3d

Open your favourite Blitz3D IDE and create a new file / project.
Insert the following code.
; Place a proper path to xors3d.bb here
; It might be "%Xors3d Engine%\headers\blitz3d\xors3d.bb%"
; or "%Blitz3d%\userlibs\xors3d.bb%"
Include "xors3d.bb" 

xGraphics3D(800, 600, 32, False, True)
camera = xCreateCamera()
light = xCreateLight()
cube = xCreateCube()
xPositionEntity(cube, 0.0, 0.0, 10.0)
While(Not (xKeyHit(KEY_ESCAPE) Or xWinMessage("WM_CLOSE")))
        xTurnEntity(cube, 0.1, 0.1, 0.1)
        xRenderWorld()
        xText(10, 10, "Hello 3D World!")
        xText(10, 30, "FPS: " + xGetFPS())
        xFlip()
Wend
End
Press 'Compile and Run' button / menu item (may vary in different IDEs).

BlitzMax

Open your favourite BlitzMax IDE and create a new file / project.
Insert the following code.
Import xorsteam.xors3d
        
xGraphics3D(800, 600, 32, False, True)
camera = xCreateCamera()
light = xCreateLight()
cube = xCreateCube()
xPositionEntity(cube, 0.0, 0.0, 10.0)
While(Not (xKeyHit(xKEY_ESCAPE) Or xWinMessage("WM_CLOSE")))
        xTurnEntity(cube, 0.1, 0.1, 0.1)
        xRenderWorld()
        xText(10, 10, "Hello 3D World!")
        xText(10, 30, "FPS: " + xGetFPS())
        xFlip()
Wend
End
Save file / project.
Copy Xors3d.dll (Squall.dll, xPhysics.dll, xScript.dll are not necessary for this project) to the folder where file / project was saved.
Press 'Build and Run' button / menu item (may vary in different IDEs).

CPP

Visual Studio 2008

Note:
For other versions of Visual Studio some steps may differ.
Create a new project. File -> New -> Project... -> Win32 -> Win32 Project. Give your project a name. Click OK. Click Finish.
Open "%Project's Name%.cpp" and replace its code with the following.
#include "stdafx.h"
#include "TestProject.h"
#include <xors3d.h>
#include <iostream>

int APIENTRY _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow)
{
        char msgBuffer[129];
        xGraphics3D(800, 600, 32, false, true);
        int camera = xCreateCamera();
        int light = xCreateLight();
        int cube = xCreateCube();
        xPositionEntity(cube, 0.0, 0.0, 10.0);
        while(!(xKeyHit(KEY_ESCAPE) || xWinMessage("WM_CLOSE")))
        {
                xTurnEntity(cube, 0.1, 0.1, 0.1);
                xRenderWorld();
                sprintf(msgBuffer, "Hello 3D World!");
                xText(10, 10, msgBuffer);
                sprintf(msgBuffer, "FPS: %i", xGetFPS());
                xText(10, 30, msgBuffer);
                xFlip();
        }
        return 0;
}
Open project's properties. Menu Project -> Properties (Alt-F7).
Go to Configuration Properties -> Linker -> Input -> Additional Dependencies.
Type-in "xors3d.lib" in "Additional Dependencies" field.
Click OK.
Build the project. Menu Build -> Build %Project's Name%.
Copy Xors3d.dll (Squall.dll, xPhysics.dll, xScript.dll are not necessary for this project) to the project's output directory (usually Release or Debug).
Run "%Project's Name%.exe".
Back to Installation
Back to Getting Started Programming With Xors3d