Blender  V3.3
gpu_batch_private.hh
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2016 by Mike Erwin. All rights reserved. */
3 
11 #pragma once
12 
13 #include "GPU_batch.h"
14 #include "GPU_context.h"
15 
18 
19 namespace blender {
20 namespace gpu {
21 
27 class Batch : public GPUBatch {
28  public:
29  virtual ~Batch() = default;
30 
31  virtual void draw(int v_first, int v_count, int i_first, int i_count) = 0;
32 
33  /* Convenience casts. */
34  IndexBuf *elem_() const
35  {
36  return unwrap(elem);
37  }
38  VertBuf *verts_(const int index) const
39  {
40  return unwrap(verts[index]);
41  }
42  VertBuf *inst_(const int index) const
43  {
44  return unwrap(inst[index]);
45  }
46 };
47 
48 } // namespace gpu
49 } // namespace blender
GPUBatch
Definition: GPU_batch.h:78
virtual void draw(int v_first, int v_count, int i_first, int i_count)=0
VertBuf * inst_(const int index) const
VertBuf * verts_(const int index) const
virtual ~Batch()=default
IndexBuf * elem_() const
static float verts[][3]
static Context * unwrap(GPUContext *ctx)