renderer.h
#ifndef CMU462_RENDERER_H
#define CMU462_RENDERER_H
#include "CMU462.h"
#include <stdio.h>
#include <string>
namespace CMU462 {
class Renderer {
public:
virtual ~Renderer( void ) { }
virtual void init( void ) = 0;
virtual void render( void ) = 0;
virtual void resize( size_t w, size_t h ) = 0;
virtual std::string name( void ) = 0;
virtual std::string info( void ) = 0;
virtual void cursor_event( float x, float y ) { }
virtual void scroll_event( float offset_x, float offset_y ) { }
virtual void mouse_event( int key, int event, unsigned char mods ) { }
virtual void keyboard_event( int key, int event, unsigned char mods ) { }
void use_hdpi_reneder_target() { use_hdpi = true; }
protected:
bool use_hdpi;
};
} // namespace CMU462
#endif // CMU462_RENDERER_H
CMU462::Renderer::~Renderer
virtual ~Renderer(void)
Virtual Destructor.
Definition: renderer.h:29
CMU462::Renderer::init
virtual void init(void)=0
Initialize the renderer.
CMU462::Renderer::resize
virtual void resize(size_t w, size_t h)=0
Respond to buffer resize.
CMU462::Renderer::info
virtual std::string info(void)=0
Return a brief description of the renderer.
CMU462
Definition: CMU462.h:8
CMU462::Renderer
Abstract renderer definition.
Definition: renderer.h:21
CMU462::Renderer::use_hdpi_reneder_target
void use_hdpi_reneder_target()
Internal - The viewer will tell the renderer if the screen is in HDPI mode.
Definition: renderer.h:121
CMU462::Renderer::scroll_event
virtual void scroll_event(float offset_x, float offset_y)
Respond to zoom event.
Definition: renderer.h:89
CMU462::Renderer::use_hdpi
bool use_hdpi
if the render target is using HIDPI
Definition: renderer.h:125
CMU462::Renderer::render
virtual void render(void)=0
Draw content.
CMU462::Renderer::mouse_event
virtual void mouse_event(int key, int event, unsigned char mods)
Respond to mouse click event.
Definition: renderer.h:102
CMU462::Renderer::keyboard_event
virtual void keyboard_event(int key, int event, unsigned char mods)
Respond to keyboard event.
Definition: renderer.h:115
CMU462::Renderer::name
virtual std::string name(void)=0
Return a name for the renderer.
CMU462::Renderer::cursor_event
virtual void cursor_event(float x, float y)
Respond to cursor events.
Definition: renderer.h:79