Download Now
Forums

    Reference Codebot.Render.Application.pas

    Part of the Codebot Render SDL package

    The Codebot.Render.Application unit runs your scenes in an SDL2 window without the LCL. Your program creates no forms. Instead, you set the properties of the global Application and call Run with your scene class:

    begin
      Application.Title := 'Joint Demo';
      Application.Run(TJointScene);
    end.
    

    TApplication is the scene host of the window, and you reach it through the Application function rather than creating one yourself. Everything runs on the thread that calls Run. That thread creates the window, the OpenGL context, the render context, and the canvas, and then on each frame it creates or switches your scene when SceneClass changes, delivers window events to it as keyboard, text, mouse, and wheel input, updates it, and swaps the buffers. Methods queued with TThread.Queue run between frames.

    If your scene has a step interval, a step thread calls its Step method, and if Step raises an exception the application stops and Run raises it again. Unless your scene handles these keys itself, F1 toggles full screen and F2 toggles vertical sync.

    You can set Title, Width, Height, Fullscreen, Sizeable, Decorated, DepthBits, StencilBits, and MultiSamples before calling Run. MultiSamples is 4 by default, or 0 on the Raspberry Pi, and the window is created without multisampling if it can't be created with it. FilesDropped tells you about files the user dropped on the window. Run returns when the window is closed, when you call Terminate, or when you set SceneClass to nil.

    Items 24 items

    NameKindLine
    Applicationfunction145
    EApplicationErrorclass68
    SSDLContextFailedconstant150
    SSDLInitFailedconstant148
    SSDLOpenGLVersionconstant151
    SSDLWindowFailedconstant149
    TApplicationclass70
    Createconstructor107
    FilesDroppedfunction116
    Runprocedure111
    SetVSyncprocedure104
    Terminateprocedure113
    Decoratedproperty133
    DepthBitsproperty138
    Fullscreenproperty130
    Heightproperty128
    MultiSamplesproperty140
    Runningproperty123
    Sceneproperty121
    SceneClassproperty119
    Sizeableproperty132
    StencilBitsproperty139
    Titleproperty125
    Widthproperty127