KiCad PCB EDA Suite
|
Define generic OpenGL functions that are common to any OpenGL target. More...
Go to the source code of this file.
Functions | |
void | OglSetMaterial (const SMATERIAL &aMaterial, float aOpacity, bool aUseSelectedMaterial=false, SFVEC3F aSelectionColor=SFVEC3F(0.0f)) |
Set OpenGL materials. | |
void | OglSetDiffuseMaterial (const SFVEC3F &aMaterialDiffuse, float aOpacity, bool aUseSelectedMaterial=false, SFVEC3F aSelectionColor=SFVEC3F(0.0f)) |
Sets only the diffuse color and keep other parameters with default values. | |
GLuint | OglLoadTexture (const IMAGE &aImage) |
Generate a new OpenGL texture. | |
void | OglGetScreenshot (wxImage &aDstImage) |
Get the pixel data of current OpenGL image. | |
void | OglDrawBackground (const SFVEC4F &aTopColor, const SFVEC4F &aBotColor) |
void | OglResetTextureState () |
Reset to default state the texture settings. | |
Define generic OpenGL functions that are common to any OpenGL target.
Definition in file ogl_utils.h.
Definition at line 185 of file ogl_utils.cpp.
Referenced by RENDER_3D_OPENGL::Redraw(), and RENDER_3D_RAYTRACE_GL::Redraw().
void OglGetScreenshot | ( | wxImage & | aDstImage | ) |
Get the pixel data of current OpenGL image.
aDstImage | the output image. the image must be destroyed to free the data. |
Definition at line 37 of file ogl_utils.cpp.
Referenced by EDA_3D_CANVAS::GetScreenshot().
GLuint OglLoadTexture | ( | const IMAGE & | aImage | ) |
Generate a new OpenGL texture.
aImage | a image to generate the texture from. |
Definition at line 96 of file ogl_utils.cpp.
References IMAGE::GetBuffer(), IMAGE::GetHeight(), and IMAGE::GetWidth().
Referenced by RENDER_3D_OPENGL::initializeOpenGL().
void OglResetTextureState | ( | ) |
Reset to default state the texture settings.
Definition at line 214 of file ogl_utils.cpp.
Referenced by RENDER_3D_OPENGL::Redraw().
void OglSetDiffuseMaterial | ( | const SFVEC3F & | aMaterialDiffuse, |
float | aOpacity, | ||
bool | aUseSelectedMaterial = false , |
||
SFVEC3F | aSelectionColor = SFVEC3F(0.0f) |
||
) |
Sets only the diffuse color and keep other parameters with default values.
aMaterialDiffuse | the diffuse color to assign to material properties. |
Definition at line 168 of file ogl_utils.cpp.
Referenced by MODEL_3D::Draw().
void OglSetMaterial | ( | const SMATERIAL & | aMaterial, |
float | aOpacity, | ||
bool | aUseSelectedMaterial = false , |
||
SFVEC3F | aSelectionColor = SFVEC3F(0.0f) |
||
) |
Set OpenGL materials.
aMaterial | a material structure with parameters to set. |
aOpacity | main model opacity 0.0 full transparent, 1.0 full opaque. |
aUseSelectedMaterial | if material should be set for selection mode. |
aSelectionColor | material to use for selection in case it is enabled. |
Definition at line 144 of file ogl_utils.cpp.
References SMATERIAL::m_Ambient, SMATERIAL::m_Diffuse, SMATERIAL::m_Emissive, SMATERIAL::m_Shininess, SMATERIAL::m_Specular, and SMATERIAL::m_Transparency.
Referenced by MODEL_3D::Draw(), RENDER_3D_OPENGL::renderBoardBody(), RENDER_3D_OPENGL::setCopperMaterial(), and RENDER_3D_OPENGL::setLayerMaterial().