#include <rendcontext.h>
Inheritance diagram for RenderContext:


Public Types | |
| enum | RenderPass { PrimaryPass, EmissivePass } |
Public Member Functions | |
| virtual void | drawGroup (const Mesh::PrimitiveGroup &group) |
| RenderPass | getRenderPass () const |
| bool | isLocked () const |
| void | lock () |
| virtual void | makeCurrent (const Mesh::Material &)=0 |
| RenderContext () | |
| RenderContext (const Mesh::Material *) | |
| void | setMaterial (const Mesh::Material *) |
| void | setRenderPass (RenderPass rp) |
| virtual void | setVertexArrays (const Mesh::VertexDescription &desc, void *vertexData)=0 |
| void | unlock () |
Private Attributes | |
| bool | locked |
| const Mesh::Material * | material |
| RenderPass | renderPass |
|
|
Definition at line 71 of file rendcontext.h. 00072 {
00073 PrimaryPass,
00074 EmissivePass,
00075 };
|
|
|
Definition at line 69 of file rendcontext.cpp. References defaultMaterial, and material. 00070 {
00071 if (_material == NULL)
00072 material = &defaultMaterial;
00073 else
00074 material = _material;
00075 }
|
|
|
Definition at line 61 of file rendcontext.cpp. References defaultMaterial. 00061 : 00062 material(&defaultMaterial), 00063 locked(false), 00064 renderPass(PrimaryPass) 00065 { 00066 }
|
|
|
Definition at line 113 of file rendcontext.cpp. References EmissivePass, GLPrimitiveModes, InvalidResource, Mesh::Material::maps, material, and renderPass. 00114 {
00115 // Skip rendering if this is the emissive pass but there's no
00116 // emissive texture.
00117 if (renderPass == EmissivePass &&
00118 material->maps[Mesh::EmissiveMap] == InvalidResource)
00119 {
00120 return;
00121 }
00122
00123 glDrawElements(GLPrimitiveModes[(int) group.prim],
00124 group.nIndices,
00125 GL_UNSIGNED_INT,
00126 group.indices);
00127 }
|
|
|
Definition at line 77 of file rendcontext.h. References renderPass. Referenced by FixedFunctionRenderContext::makeCurrent(). 00077 { return renderPass; }
|
|
|
Definition at line 69 of file rendcontext.h. References locked. 00069 { return locked; }
|
|
|
Definition at line 67 of file rendcontext.h. References locked. Referenced by renderModelDefault(). 00067 { locked = true; }
|
|
|
Implemented in FixedFunctionRenderContext, VP_FP_RenderContext, VP_Combiner_RenderContext, and GLSL_RenderContext. Referenced by setMaterial(). |
|
|
Definition at line 84 of file rendcontext.cpp. References defaultMaterial, EmissivePass, locked, makeCurrent(), Mesh::Material::maps, material, PrimaryPass, and renderPass. Referenced by renderModelDefault(). 00085 {
00086 if (!locked)
00087 {
00088 if (newMaterial == NULL)
00089 newMaterial = &defaultMaterial;
00090
00091 if (renderPass == PrimaryPass)
00092 {
00093 if (newMaterial != material)
00094 {
00095 material = newMaterial;
00096 makeCurrent(*material);
00097 }
00098 }
00099 else if (renderPass == EmissivePass)
00100 {
00101 if (material->maps[Mesh::EmissiveMap] !=
00102 newMaterial->maps[Mesh::EmissiveMap])
00103 {
00104 material = newMaterial;
00105 makeCurrent(*material);
00106 }
00107 }
00108 }
00109 }
|
|
|
Definition at line 78 of file rendcontext.h. References renderPass. Referenced by renderModelDefault(). 00078 { renderPass = rp; }
|
|
||||||||||||
|
Implemented in FixedFunctionRenderContext, VP_FP_RenderContext, VP_Combiner_RenderContext, and GLSL_RenderContext. |
|
|
Definition at line 68 of file rendcontext.h. References locked. 00068 { locked = false; }
|
|
|
Definition at line 82 of file rendcontext.h. Referenced by isLocked(), lock(), setMaterial(), and unlock(). |
|
|
Definition at line 81 of file rendcontext.h. Referenced by drawGroup(), RenderContext(), and setMaterial(). |
|
|
Definition at line 83 of file rendcontext.h. Referenced by drawGroup(), getRenderPass(), setMaterial(), and setRenderPass(). |
1.4.1