Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 59 lines (44 sloc) 1.958 kb
f329a53 Raphael Sebbe imported
rsebbe authored
1 //
2 // GLDrawCommand.h
3 // CeedGL
4 //
5 // Created by Raphael Sebbe on 01/11/10.
6 // Copyright (c) 2010 Creaceed. All rights reserved.
7 //
8
9 #import <Foundation/Foundation.h>
10 #import <CeedGL/GLPlatform.h>
11
12 @class GLBuffer, GLProgram, GLTexture, GLValue;
13
14 @interface GLDrawCommand : NSObject {
15 GLint mFirstElement, mElementCount;
16 GLProgram *mProgram;
17 GLBuffer *mElementIndexes;
18 GLenum mElementIndexType; // GL_UNISGNED_BYTE, GL_UNSIGNED_SHORT, GL_UNSIGNED_INT (INT not on GL_ES)
19 GLenum mMode; // ex. GL_LINES, GL_TRIANGLES
20
21 NSMutableDictionary *mTextures;
22 NSMutableDictionary *mUniforms;
23 NSMutableDictionary *mAttributes;
24 }
25
26 @property (readwrite, nonatomic) GLint firstElement, elementCount;
27 @property (readonly, nonatomic, retain) GLBuffer *elementIndexes;
28 @property (readonly, nonatomic) GLenum elementIndexType;
29 @property (readwrite, nonatomic) GLenum mode;
30 @property (readwrite, nonatomic, retain) GLProgram *program;
31
32 + (GLDrawCommand*)drawCommand;
33
34 // Setting State
35 - (void)setElementIndexes:(GLBuffer*)buffer type:(GLenum)type;
36
37 - (void)setTexture:(GLTexture*)texture target:(GLenum)target unit:(GLenum)unit; // GL_TEXTURE0, ...
38 - (GLTexture*)textureForUnit:(GLenum)unit;
39 - (void)removeTextureForUnit:(GLenum)unit;
40
41 - (void)setUniform:(GLValue*)value forName:(NSString*)name;
42 - (GLValue*)uniformForName:(NSString*)name;
43 - (void)removeUniformForName:(NSString*)name;
44
45 - (void)setAttribute:(GLValue*)value forName:(NSString*)name;
46 - (void)setAttributeBuffer:(GLBuffer*)buffer size:(GLint)size type:(GLenum)type normalized:(GLboolean)norm stride:(GLsizei)stride offset:(GLsizeiptr)off forName:(NSString*)name;
47 - (id)attributeForName:(NSString*)name;
48 - (void)removeAttributeForName:(NSString*)name;
49
50 // Drawing
51 // draw with attributes and internal program
52 - (void)draw;
53
54 // draw with an overriding program, matching attributes and uniforms will be set appropriately
55 //- (void)drawWithProgram:(GLProgram*)program;
56
57
58 @end
Something went wrong with that request. Please try again.