-
Notifications
You must be signed in to change notification settings - Fork 2
Lesson 00
If you are not already looking at code, go ahead and clone (or download) the repository, open up the solution file therein, navigate to the "Lesson00" project and open up the "Main.cs" file.
These lines of code you see now are the beginning of every FUSEE project and of course they'll compile and run just fine. If you actually run it you will see a white screen and not much proof of you running a 3D engine, but we'll get to that, first lets discuss this bare bone.
public class Lesson00 : RenderCanvas {}
The main class of an FUSEE project must be derived from RenderCanvas.
public override void Init() {}
This method is called once the program starts, you can use it initialize variables.
RC.ClearColor = new float4(1, 1, 1, 1);
This line sets the clear color, you could also say the background color for the scene. The RC you see here is the "RenderContext", it handels everything about the rendering.
public override void RenderAFrame() {}
This methode is called every frame, most of your code will be in here, or be called from here.
RC.Clear(ClearFlags.Color | ClearFlags.Depth);
This calls the RenderContext to clear the frame and depth buffer.
Present();
This presents the framebuffer on the screen.
We'll not go any further into the Resize()
or Main()
methodes, since it is very unlikely that you find a reason to change them.
These are the bare bone basics for a FUSEE application. Let's get something on the screen.
[> Lesson 01 - Getting a picture](Lesson 01)