Skip to content

Bulb4/renderer

Repository files navigation

Example

SOURCE *click* alt text

Usage

Include:

git submodule add https://github.com/Bulb4/renderer.git
#include "..//renderer/include/renderer.h"

Initializing:

If bUseDynamicSinCos is true, circle drawing will be faster but also it will take more memory. Use it if you do not change points count in runtime

cRender* pRender = new cRender(g_pd3dDevice, true);//g_pd3dDevice is our IDirect3DDevice9

ID3DXFont* font1 = nullptr;
pRender->AddFont(&font1, "Consolas", 48, false);

pRender->SetFramerateUpdateRate(400U);

In your drawing function(EndScene, Present, etc.):

pRender->BeginDraw();
 
//drawing stuff
 
pRender->EndDraw();

In your Reset:

pRender->OnLostDevice();

if (g_pd3dDevice->Reset(&g_d3dpp) >= 0)
    pRender->OnResetDevice();

Notes:

  • Use pRender->GetFramerate() for fps monitoring and you can change it's update rate by pRender->SetFramerateUpdateRate(400U);//ms
  • Use pRender->PushRenderState(...) if you need to use some render states while drawing, but you need to return it's previous value after.
  • Use DrawBox(...) without short thickness argument if the thickness is 1.

Contacts:

  • Discord: Bulb4#2901
  • Steam: Bulb4<3
  • e-mail: bulb4main@gmail.com

About

Simple directx9 2d drawing class

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages