 |
Shiokaze Framework
A research-oriented fluid solver for computer graphics
|
|
Go to the documentation of this file.
25 #ifndef SHKZ_GRAPHICS_ENGINE_H
26 #define SHKZ_GRAPHICS_ENGINE_H
49 virtual void setup_graphics ( std::map<std::string,const void *> params=std::map<std::string,const void *>() ) = 0;
81 virtual void set_viewport(
unsigned x,
unsigned y,
unsigned width,
unsigned height ) = 0;
86 virtual void get_viewport(
unsigned &x,
unsigned &y,
unsigned &width,
unsigned &height )
const = 0;
99 virtual void set_2D_coordinate(
double left,
double right,
double bottom,
double top ) = 0;
116 virtual void look_at(
const double target[3],
const double position[3],
const double up[3],
double fov,
double near,
double far ) = 0;
121 virtual void clear() = 0;
136 void color3(
double r,
double g,
double b ) {
137 double v[] = { r, g, b };
144 void color4(
double r,
double g,
double b,
double a ) {
145 double v[] = { r, g, b, a };
152 template <
class T>
void color3v(
const T *v ) {
153 double v_plus_alpha[] = { v[0], v[1], v[2], 1.0 };
160 virtual void color4v(
const double *v ) = 0;
166 double p[] = { v[0], v[1], v[2], v[3] };
174 double v[] = { x, y, 0.0 };
181 void vertex3(
double x,
double y,
double z ) {
182 double v[] = { x, y, z};
220 virtual void end() = 0;
236 double v_3d_added[] = { v[0], v[1], 0.0 };
243 virtual void vertex3v(
const double *v ) = 0;
249 double p[] = { v[0], v[1], v[2] };
262 virtual void draw_string(
const double *v, std::string str,
unsigned size=0 ) = 0;
void vertex2v(const T *v)
Equivalebt to glVertex. See https://www.khronos.org/registry/OpenGL-Refpages/gl2.1/xhtml/glVertex....
Definition: graphics_engine.h:235
Class that converts color spaces.
Definition: color.h:25
@ TRIANGLE_FAN
Connected group of triangles as fan.
virtual void set_2D_coordinate(double left, double right, double bottom, double top)=0
Configure 2D coordinate view.
FEATURE
List of features that can be specified to get_supported().
Definition: graphics_engine.h:53
virtual void end()=0
Equivalebt to glEnd. See https://www.khronos.org/registry/OpenGL-Refpages/gl2.1/xhtml/glEnd....
virtual bool get_supported(FEATURE feature) const =0
Get if a specified feature is supported.
void vertex3(double x, double y, double z)
Equivalebt to glVertex. See https://www.khronos.org/registry/OpenGL-Refpages/gl2.1/xhtml/glVertex....
Definition: graphics_engine.h:181
void color4v(const float *v)
Equivalebt to glColor. See https://www.khronos.org/registry/OpenGL-Refpages/gl2.1/xhtml/glColor....
Definition: graphics_engine.h:165
@ LINES
Independent lines segmemts.
virtual void point_size(double size)=0
Equivalebt to glPointSize. See https://www.khronos.org/registry/OpenGL-Refpages/gl2....
virtual std::string get_graphics_engine_name() const =0
Get the name of the graphics engine.
void color4(double r, double g, double b, double a)
Equivalebt to glColor. See https://www.khronos.org/registry/OpenGL-Refpages/gl2.1/xhtml/glColor....
Definition: graphics_engine.h:144
virtual void set_viewport(unsigned x, unsigned y, unsigned width, unsigned height)=0
Set view port.
virtual void get_viewport(unsigned &x, unsigned &y, unsigned &width, unsigned &height) const =0
Get view port.
virtual ~graphics_engine()=default
Default destructor.
void vertex2(double x, double y)
Equivalebt to glVertex. See https://www.khronos.org/registry/OpenGL-Refpages/gl2.1/xhtml/glVertex....
Definition: graphics_engine.h:173
virtual void vertex3v(const double *v)=0
Equivalebt to glVertex. See https://www.khronos.org/registry/OpenGL-Refpages/gl2.1/xhtml/glVertex....
#define SHKZ_BEGIN_NAMESPACE
Name space beggining definition for shiokaze.
Definition: common.h:39
@ _3D
Support for 3D perspective.
void color3(double r, double g, double b)
Equivalebt to glColor. See https://www.khronos.org/registry/OpenGL-Refpages/gl2.1/xhtml/glColor....
Definition: graphics_engine.h:136
virtual void setup_graphics(std::map< std::string, const void * > params=std::map< std::string, const void * >())=0
Initialize graphics engine.
void vertex3v(const float *v)
Equivalebt to glVertex. See https://www.khronos.org/registry/OpenGL-Refpages/gl2.1/xhtml/glVertex....
Definition: graphics_engine.h:248
virtual void draw_string(const double *v, std::string str, unsigned size=0)=0
Draw a string at the current position.
void color3v(const T *v)
Equivalebt to glColor. See https://www.khronos.org/registry/OpenGL-Refpages/gl2.1/xhtml/glColor....
Definition: graphics_engine.h:152
MODE
List of drawing mode that is to be specified with begin() function. See https://www....
Definition: graphics_engine.h:188
@ LINE_STRIP
Connected group of line segments.
virtual void line_width(double width)=0
Equivalebt to glLineWidth. See https://www.khronos.org/registry/OpenGL-Refpages/gl2....
@ TRIANGLE_STRIP
Connected group of triangles.
@ OPACITY
Support for opacity (alpha) drawing.
virtual void clear()=0
Clear out the canvas.
virtual void look_at(const double target[3], const double position[3], const double up[3], double fov, double near, double far)=0
Set up a camera with a target position, origin position and fov.
virtual void get_background_color(double color[3]) const =0
Get the background color.
@ TRIANGLES
Independent triangles.
virtual void begin(MODE mode)=0
Equivalebt to glBegin. See https://www.khronos.org/registry/OpenGL-Refpages/gl2.1/xhtml/glBegin....
#define SHKZ_END_NAMESPACE
Name space end definition for shiokaze.
Definition: common.h:44
Interface for handling drawing operations.
Definition: graphics_engine.h:38
virtual void get_foreground_color(double color[3]) const =0
Get the foreground color.
virtual void color4v(const double *v)=0
Equivalebt to glColor. See https://www.khronos.org/registry/OpenGL-Refpages/gl2.1/xhtml/glColor....