GLVis  v4.2
Accurate and flexible finite element visualization
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
renderer_ff.hpp
Go to the documentation of this file.
1 // Copyright (c) 2010-2022, Lawrence Livermore National Security, LLC. Produced
2 // at the Lawrence Livermore National Laboratory. All Rights reserved. See files
3 // LICENSE and NOTICE for details. LLNL-CODE-443271.
4 //
5 // This file is part of the GLVis visualization tool and library. For more
6 // information and source code availability see https://glvis.org.
7 //
8 // GLVis is free software; you can redistribute it and/or modify it under the
9 // terms of the BSD-3 license. We welcome feedback and contributions, see file
10 // CONTRIBUTING.md for details.
11 
12 #ifndef GLVIS_RENDERER_FF_HPP
13 #define GLVIS_RENDERER_FF_HPP
14 
15 #include "renderer.hpp"
16 
17 namespace gl3
18 {
19 
20 // Render for legacy OpenGL systems with access to only the fixed-function
21 // pipeline
22 class FFGLDevice : public GLDevice
23 {
24  struct DispListData_
25  {
26  DispListHandle list;
27  GLenum shape;
28  size_t count;
29  array_layout layout;
30  };
31  std::vector<DispListData_> disp_lists;
32 
33  template<typename TVtx>
34  void bufferFFDeviceImpl(const VertexBuffer<TVtx>& buf);
35 
36  template<typename TVtx>
37  void bufferFFDeviceImpl(const IndexedVertexBuffer<TVtx>& buf);
38 public:
40  {
41  disp_lists.emplace_back(DispListData_{}); // dummy for index 0
42  }
43 
44  DeviceType getType() override { return GLDevice::FF_DEVICE; }
45 
46  void init() override;
47  void setTransformMatrices(glm::mat4 model_view, glm::mat4 projection) override;
48  void setNumLights(int i) override;
49  void setMaterial(Material mat) override;
50  void setPointLight(int i, Light lt) override;
51  void setAmbientLight(const std::array<float, 4>& amb) override;
52  void setClipPlaneUse(bool enable) override;
53  void setClipPlaneEqn(const std::array<double, 4>& eqn) override;
54 
55  void bufferToDevice(array_layout layout, IVertexBuffer& buf) override;
56  void bufferToDevice(array_layout layout, IIndexedBuffer& buf) override;
57  void bufferToDevice(TextBuffer& t_buf) override;
58  void drawDeviceBuffer(int hnd) override;
59  void drawDeviceBuffer(const TextBuffer& t_buf) override;
60  void captureXfbBuffer(PaletteState& pal, CaptureBuffer& cbuf, int hnd) override;
61 };
62 
63 }
64 
65 #endif // GLVIS_RENDERER_FF_HPP
void bufferToDevice(array_layout layout, IVertexBuffer &buf) override
void setTransformMatrices(glm::mat4 model_view, glm::mat4 projection) override
Definition: renderer_ff.cpp:90
void setClipPlaneEqn(const std::array< double, 4 > &eqn) override
void setPointLight(int i, Light lt) override
array_layout
Definition: types.hpp:170
void drawDeviceBuffer(int hnd) override
void setNumLights(int i) override
void setMaterial(Material mat) override
void captureXfbBuffer(PaletteState &pal, CaptureBuffer &cbuf, int hnd) override
DeviceType getType() override
Definition: renderer_ff.hpp:44
void init() override
Definition: renderer_ff.cpp:66
void setAmbientLight(const std::array< float, 4 > &amb) override
void setClipPlaneUse(bool enable) override