Blender  V2.93
gl_drawlist.hh
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * The Original Code is Copyright (C) 2020 Blender Foundation.
17  * All rights reserved.
18  */
19 
27 #pragma once
28 
29 #include "MEM_guardedalloc.h"
30 
31 #include "BLI_sys_types.h"
32 
33 #include "GPU_batch.h"
34 
35 #include "gpu_drawlist_private.hh"
36 
37 #include "gl_context.hh"
38 
39 namespace blender {
40 namespace gpu {
41 
45 class GLDrawList : public DrawList {
46  public:
47  GLDrawList(int length);
48  ~GLDrawList();
49 
50  void append(GPUBatch *batch, int i_first, int i_count) override;
51  void submit(void) override;
52 
53  private:
54  void init(void);
55 
57  GLBatch *batch_;
59  GLbyte *data_;
61  GLsizeiptr data_size_;
63  GLintptr command_offset_;
65  uint command_len_;
67  GLuint base_index_;
69  GLuint v_first_, v_count_;
70 
72  GLuint buffer_id_;
74  GLsizeiptr buffer_size_;
76  GLintptr data_offset_;
77 
79  GLContext *context_;
80 
81  MEM_CXX_CLASS_ALLOC_FUNCS("GLDrawList");
82 };
83 
84 } // namespace gpu
85 } // namespace blender
unsigned int uint
Definition: BLI_sys_types.h:83
GPUBatch
Definition: GPU_batch.h:93
Read Guarded memory(de)allocation.
SIMD_FORCE_INLINE btScalar length(const btQuaternion &q)
Return the length of a quaternion.
Definition: btQuaternion.h:895
void submit(void) override
Definition: gl_drawlist.cc:177
void append(GPUBatch *batch, int i_first, int i_count) override
Definition: gl_drawlist.cc:121
GPUBatch * batch
Definition: drawnode.c:3779