Gem-graph 0.1.0
A modelling tool based on rewriting of geometric graphs.
Loading...
Searching...
No Matches
Functions
draw.c File Reference

graphics - general drawing functions More...

#include <cglm/cglm.h>
#include "../../include/base.h"
#include "../../include/graphics.h"

Functions

void graphics_draw_vertex (const int stack_id, GLfloat x, GLfloat y, GLfloat z)
 Writes values to describe a vertex at (x,y,z) intoq the vertex buffer.
 
void graphics_draw_color (const int stack_id, GLfloat r, GLfloat g, GLfloat b)
 Writes values to describe a color (r,g,b) into the color buffer.
 
void graphics_draw_line (const int stack_id, GLuint a, GLuint b)
 Writes values to describe a line from a to b into the line buffer.
 
void graphics_draw_plan (const int stack_id, GLuint a, GLuint b, GLuint c)
 Writes values to describe an (a,b,c) plan (triangle) into the plan buffer.
 
void graphics_draw (const int stack_id)
 Draws the current buffer to a gl_area.
 

Detailed Description

graphics - general drawing functions

This file is part of Gem-graph.

Function Documentation

◆ graphics_draw()

void graphics_draw ( const int  stack_id)

Draws the current buffer to a gl_area.

Parameters
stack_idgl_area, ptr to the gl_area widget

◆ graphics_draw_color()

void graphics_draw_color ( const int  stack_id,
GLfloat  r,
GLfloat  g,
GLfloat  b 
)

Writes values to describe a color (r,g,b) into the color buffer.

Draws the color (r, g, b) associated to a vertex if (console) prints (r, g, b) values to console.

Parameters
colorGLfloat(r,g,b)

◆ graphics_draw_line()

void graphics_draw_line ( const int  stack_id,
GLuint  a,
GLuint  b 
)

Writes values to describe a line from a to b into the line buffer.

Parameters
coordsGLuint (a,b)

◆ graphics_draw_plan()

void graphics_draw_plan ( const int  stack_id,
GLuint  a,
GLuint  b,
GLuint  c 
)

Writes values to describe an (a,b,c) plan (triangle) into the plan buffer.

Parameters
coordsGLuint (a,b,c)

◆ graphics_draw_vertex()

void graphics_draw_vertex ( const int  stack_id,
GLfloat  x,
GLfloat  y,
GLfloat  z 
)

Writes values to describe a vertex at (x,y,z) intoq the vertex buffer.

Draws a vertex (x, y, z) if (console) prints (x, y, z) values to console.

Parameters
coordsGLfloat(x,y,z)