File: glMultiDrawElementsBaseVertex.m

package info (click to toggle)
psychtoolbox-3 3.0.19.14.dfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 86,796 kB
  • sloc: ansic: 176,245; cpp: 20,103; objc: 5,393; sh: 2,753; python: 1,397; php: 384; makefile: 193; java: 113
file content (37 lines) | stat: -rw-r--r-- 1,498 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
function glMultiDrawElementsBaseVertex( mode, count, type, indices, drawcount, basevertex )

% glMultiDrawElementsBaseVertex  Interface to OpenGL function glMultiDrawElementsBaseVertex
%
% usage:  glMultiDrawElementsBaseVertex( mode, count, type, indices, drawcount, basevertex )
%
% Note: indices must be a cell array whose cells contain uint32() type
% vectors with the indices!
%
% C function:  void glMultiDrawElementsBaseVertex(GLenum mode, const GLsizei* count, GLenum type, const GLvoid** indices, GLsizei drawcount, const GLint* basevertex)

% 30-Aug-2012 -- created (generated automatically from header files)

% ---protected---

if nargin~=6,
    error('invalid number of arguments');
end

% Ok, the moglcore() implementation doesn't work due to the double-indirect
% pointer, indices[] being an array of pointers to actual separate arrays
% of indices -- Difficult to handle / to pass from Matlab API to C API.
%
% Therefore this call is disabled:
% moglcore( 'glMultiDrawElementsBaseVertex', mode, int32(count), type, const, drawcount, int32(basevertex) );

% Instead, we reimplement the behaviour of the function by iterative use of
% glDrawElementsBaseVertex(), following the specification from the official
% spec of glMultiDrawElementsBaseVertex(), which says exactly how to do
% this / defines the function in terms of iterating:
for i = 1:drawcount
    if count(i) > 0
        glDrawElementsBaseVertex(mode, count(i), type, uint32(indices{i}), basevertex(i));
    end
end

return