source: nanovis/branches/1.1/graphics/IndexBuffer.cpp @ 5722

Last change on this file since 5722 was 3465, checked in by ldelgass, 11 years ago

Rename R2 library to nv::graphics and nv::util.

  • Property svn:eol-style set to native
File size: 566 bytes
Line 
1/* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
2/*
3 *  Copyright (c) 2004-2013  HUBzero Foundation, LLC
4 */
5#include <stdlib.h>
6#include <memory.h>
7
8#include "IndexBuffer.h"
9
10using namespace nv::graphics;
11
12IndexBuffer::IndexBuffer(int indexCount, int* data, bool copy) :
13    _indexCount(indexCount)
14{
15    if (copy) {
16        _data = (int*)malloc(sizeof(int) * indexCount);
17        memcpy(_data, data, sizeof(int) * indexCount);
18    } else {
19        _data = data;
20    }
21}
22
23IndexBuffer::~IndexBuffer()
24{
25    if (_data) {
26        free(_data);
27    }
28}
Note: See TracBrowser for help on using the repository browser.