Last change
on this file since 3463 was
3463,
checked in by ldelgass, 11 years ago
|
Begin process of renaming R2 library
|
-
Property svn:eol-style set to
native
|
File size:
520 bytes
|
Line | |
---|
1 | /* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- */ |
---|
2 | #include <stdlib.h> |
---|
3 | #include <memory.h> |
---|
4 | |
---|
5 | #include <R2/graphics/R2IndexBuffer.h> |
---|
6 | |
---|
7 | using namespace nv::graphics; |
---|
8 | |
---|
9 | IndexBuffer::IndexBuffer(int indexCount, int* data, bool copy) : |
---|
10 | _indexCount(indexCount) |
---|
11 | { |
---|
12 | if (copy) { |
---|
13 | _data = (int*)malloc(sizeof(int) * indexCount); |
---|
14 | memcpy(_data, data, sizeof(int) * indexCount); |
---|
15 | } else { |
---|
16 | _data = data; |
---|
17 | } |
---|
18 | } |
---|
19 | |
---|
20 | IndexBuffer::~IndexBuffer() |
---|
21 | { |
---|
22 | if (_data) { |
---|
23 | free(_data); |
---|
24 | } |
---|
25 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.