Skip to content
This repository has been archived by the owner on Jul 19, 2020. It is now read-only.
/ renderer_d3d9 Public archive

Simple and fast Direct3D 9 renderer that offers easy extensibility

License

Notifications You must be signed in to change notification settings

yazzn/renderer_d3d9

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Direct3D 9 Renderer

This is a simple Direct3D 9 renderer that is able to draw deferred using render lists. For text rendering a forked version of CD3DFont was used.

Quick guide

#include "renderer.hpp"

RendererPtr renderer;
RenderListPtr render_list;

// init once
{
  renderer = std::make_shared<Renderer>(device, 1536);
  render_list = renderer->make_render_list();
  renderer->draw_filled_rect(render_list, { 100.f, 300.f, 200.f, 150.f }, 0xff00ff00); // adds vertices to render_list
}

// in your render loop
{
  device->Clear(...);
  device->BeginScene(...);

  renderer->begin(); // sets necessary render states

  renderer->draw_filled_rect({ 100.f, 100.f, 200.f, 150.f }, 0xffff0000); // adds vertices to internal render list

  renderer->draw(render_list); // draws render_list
  renderer->draw(); // draws internal render list and resets its vertices
  renderer->end(); // restores previous render states

  device->EndScene(...);
  device->Present(...);
}

About

Simple and fast Direct3D 9 renderer that offers easy extensibility

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages