1
0
mirror of https://github.com/thes3m/XNI synced 2024-12-26 13:26:06 +01:00
Matej Jan 668bba9869 Added user primitive rendering.
git-svn-id: http://xni.googlecode.com/svn/XNI@23 ac433895-eea3-a490-d80a-17149a75e588
2010-09-21 21:46:53 +00:00

51 lines
815 B
Objective-C

//
// VertexArray.m
// XNI
//
// Created by Matej Jan on 21.9.10.
// Copyright 2010 Retronator. All rights reserved.
//
#import "VertexArray.h"
#import "System.h"
@implementation VertexArray
- (id) initWithItemSize:(int)itemSize initialCapacity:(int)initialCapacity {
if (self = [super init]) {
array = [[AdaptiveArray alloc] initWithItemSize:itemSize initialCapacity:initialCapacity];
}
return self;
}
- (void *) array {
return array.array;
}
- (int) count {
return array.count;
}
- (int) sizeInBytes {
return array.count * array.itemSize;
}
- (VertexDeclaration *) vertexDeclaration { return nil; }
- (void) clear {
[array clear];
}
- (void) addVertex:(void *)vertex {
[array addItem:vertex];
}
- (void) dealloc
{
[array release];
[super dealloc];
}
@end