SoftPixel Engine 3.2 API documentation



Welcome to the SoftPixel Engine API documentation where you can find each function available for the current version. For detailed questions you can joint the SoftPixel Forum and ask questions in the section of the SoftPixel Engine.

You can also download this API docu as ZIP file



Getting started

This is the "GettingStarted" tutorial for the first step using the SoftPixel Engine.

 #include <SoftPixelEngine.hpp>
 using namespace sp; // Main namespace
 int main()
     // The softpixel-device opens the screen (windowed screen or fullscreen is possible)
     SoftPixelDevice* spDevice = createGraphicsDevice(
         video::RENDERER_AUTODETECT, dim::size2di(640, 480), 32, "GettingStarted"
     video::RenderSystem* spRenderer = spDevice->getRenderSystem();   // Get the render system for drawing and rendering operations.
     video::RenderContext* spContext = spDevice->getRenderContext();  // Get the render context to flip video buffers and change settings of the main window.
     io::InputControl* spControl = spDevice->getInputControl();       // Get the input controller for keyboard- and mouse events.
     scene::SceneGraph* spScene = spDevice->createSceneGraph();       // Create a scene graph where all the 3d objects are stored and handled.
     spScene->setLighting(true);                                      // Enable global lighting.
     scene::Camera* Cam = spScene->createCamera();                    // Create a view camera whose field of view is rendered.
     scene::Light* Lit = spScene->createLight();                      // Create a light source. By default directional light.
     scene::Mesh* Obj = spScene->createMesh(scene::MESH_TEAPOT);      // Create a renderable mesh object from the standard geometry library.
     Obj->setPosition(dim::vector3df(0, 0, 2.5));                     // Set the object's position (x, y, z).
     // The main loop in which the device will be updated
     while (spDevice->updateEvents() && !spControl->keyDown(io::KEY_ESCAPE))
         spRenderer->clearBuffers();                                  // Clear the video buffer (Color and depth buffer).
         spScene->renderScene();                                      // Render the whole scene.
         Obj->turn(dim::vector3df(1, 1, 1));                          // Rotate our object to present it.
         spContext->flipBuffers();                                    // Flip the video buffers (Color and depth buffer). Now we can see the current frame.
     deleteDevice();                                                  // Delete the engine device. This deletes all allocated resources and closes the graphics screen.
     return 0;
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines