Skip to content

Instantly share code, notes, and snippets.

@mousebird
Created August 7, 2013 00:43
Show Gist options
  • Select an option

  • Save mousebird/6170268 to your computer and use it in GitHub Desktop.

Select an option

Save mousebird/6170268 to your computer and use it in GitHub Desktop.
//
// FlexiVertexBuffer.h
// NSMeetupExample
//
// Created by sjg@mousebirdconsulting.com on 8/6/13.
//
#import <UIKit/UIKit.h>
#import "SimpleGLObject.h"
@interface FlexiVertexBuffer : NSObject
// Create a flexi buffer with the vertices for a cube centered at the origin
// of the given size
+ (FlexiVertexBuffer *)BufferWithCubeAt:(float *)org sized:(float *)size;
// Add a cube to the existing vertices
- (void)addCubeAt:(float *)org sized:(float *)size;
// Vertices are always 24 bytes (3 floats for location + 3 floats for normal)
@property GLuint vertexSize;
// Number of vertices
@property GLuint numVertices;
// Interleaved vertex data
@property NSMutableData *vertices;
// Create a GL Object and its associated buffer from a flexi buffer
- (SimpleGLObject *)makeSimpleGLObject;
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment