Giter Club home page Giter Club logo

renderer_d3d9's Introduction

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(...);
}

renderer_d3d9's People

Contributors

yazzn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

renderer_d3d9's Issues

Add circle rotation

Hi, can you add a fast circle rotation(in 3d) algorithm to your draw_circle function?

tyvm

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.