====== Camera Textures ====== It's possible to render a texture captured from an in-game camera to use on a GUI texture - for example, for showing images on security monitors etc. ===== Setup ===== First of all you create a camera texture and give it a name. **For best results the size (avSize below) should match the size of the texture you want to draw on-screen.** Method: ''void Gui_CreateCameraTexture(tString asName, cVector2l avSize, uint alFrameRate, float afFOV, float afNearPlane, float afFarPlane);'' and then attach the camera texture to a particular entity. This entity's position and rotation will be the viewpoint the camera is rendered from. **Don't point this towards the terminal showing the image!** Method: ''void Gui_AttachCameraTextureToEntity(tString asName, tString asEntity);'' For example: Gui_CreateCameraTexture("DunbatCamera", cVector2l(768, 613), 10, 60.0f, 0.1, 10); Gui_AttachCameraTextureToEntity("DunbatCamera", "DunbatCameraArea"); ===== Rendering ===== In your OnGui function, you just render (as if it were any kind of texture) an image texture with the same name as the camera texture and the argument eImGuiGfx_Special. For example: cImGuiGfx gfx("DunbatCamera", eImGuiGfx_Special); ImGui_DrawGfx(gfx, cVector3f(0,0,5.0f), ImGui_GetSize(), cColor(1, 1));