Skip to content

Bulb4/renderer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

author
Nikita
Nov 21, 2018
628b114 · Nov 21, 2018

History

23 Commits
Sep 18, 2018
Nov 21, 2018
Jul 18, 2018
Jul 18, 2018
Sep 18, 2018
Jul 18, 2018
Sep 18, 2018
Sep 18, 2018

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:


About

Simple directx9 2d drawing class

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages