MCPcopy Create free account
hub / github.com/arrayfire/forge / surface_impl

Class surface_impl

src/backend/opengl/surface_impl.hpp:24–79  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22{
23
24class surface_impl : public AbstractRenderable {
25 protected:
26 /* plot points characteristics */
27 gl::GLuint mNumXPoints;
28 gl::GLuint mNumYPoints;
29 gl::GLenum mDataType;
30 forge::MarkerType mMarkerType;
31 /* OpenGL Objects */
32 gl::GLuint mIBO;
33 size_t mIBOSize;
34 ShaderProgram mMarkerProgram;
35 ShaderProgram mSurfProgram;
36 /* shared variable index locations */
37 gl::GLuint mMarkerMatIndex;
38 gl::GLuint mMarkerPointIndex;
39 gl::GLuint mMarkerColorIndex;
40 gl::GLuint mMarkerAlphaIndex;
41 gl::GLuint mMarkerPVCIndex;
42 gl::GLuint mMarkerPVAIndex;
43 gl::GLuint mMarkerTypeIndex;
44 gl::GLuint mMarkerColIndex;
45
46 gl::GLuint mSurfMatIndex;
47 gl::GLuint mSurfRangeIndex;
48 gl::GLuint mSurfPointIndex;
49 gl::GLuint mSurfColorIndex;
50 gl::GLuint mSurfAlphaIndex;
51 gl::GLuint mSurfPVCIndex;
52 gl::GLuint mSurfPVAIndex;
53
54 std::map<int, gl::GLuint> mVAOMap;
55
56 /* bind and unbind helper functions
57 * for rendering resources */
58 void bindResources(const int pWindowId);
59 void unbindResources() const;
60 glm::mat4 computeTransformMat(const glm::mat4& pView, const glm::mat4& pOrient);
61 virtual void renderGraph(const int pWindowId, const glm::mat4& transform);
62
63 public:
64 surface_impl(const uint pNumXpoints, const uint pNumYpoints,
65 const forge::dtype pDataType, const forge::MarkerType pMarkerType);
66 ~surface_impl();
67
68 void render(const int pWindowId,
69 const int pX, const int pY, const int pVPW, const int pVPH,
70 const glm::mat4 &pView, const glm::mat4 &pOrient);
71
72 inline void usePerVertexColors(const bool pFlag=true) {
73 mIsPVCOn = pFlag;
74 }
75
76 inline void usePerVertexAlphas(const bool pFlag=true) {
77 mIsPVAOn = pFlag;
78 }
79};
80
81class scatter3_impl : public surface_impl {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected