Josh's Graphics Library
JGL::VRamList Class Reference

A wrapped for "Vertex Buffer Object" In OpenGL, Store things in VRam. More...

#include <VRamList.h>

Public Member Functions

 VRamList (const GLuint *data, const long &length)
 
 VRamList (const GLfloat *data, const long &length)
 
 VRamList (const Vector2 *data, const long &length)
 
 VRamList (const Vector3 *data, const long &length)
 
 VRamList (const Vector4 *data, const long &length)
 
 ~VRamList ()
 
 VRamList (const VRamList &rhs)
 Copying around the VBO data to a new VBO like this is slow. More...
 
 VRamList ()=default
 
GLuint GetHandle () const
 
long GetLength () const
 Returns the number of elements in the list. More...
 
size_t GetSize () const
 Returns the size of the data in bytes. More...
 
std::vector< GLfloat > GetDataF () const
 Get VBO data back from the GPU. More...
 
std::vector< GLuint > GetDataUI () const
 
bool IsFloatArray () const
 
void SetData (const GLfloat *data, const long &length)
 Replace the data of an existing VBO in it's entirety. More...
 
void SetData (const Vector2 *data, const long &length)
 
void SetData (const Vector3 *data, const long &length)
 
void SetData (const Vector4 *data, const long &length)
 
void SetData (const GLuint *data, const long &length)
 
void SetData (const Vector2i *data, const long &length)
 
void UpdateData (const GLfloat *data, const long &offset, const long &length)
 Update only a portion of the data in a VBO. More...
 
void UpdateData (const Vector2 *data, const long &offset, const long &length)
 
void UpdateData (const Vector3 *data, const long &offset, const long &length)
 
void UpdateData (const Vector4 *data, const long &offset, const long &length)
 
void UpdateData (const GLuint *data, const long &offset, const long &length)
 
void UpdateData (const Vector2i *data, const long &offset, const long &length)
 

Detailed Description

A wrapped for "Vertex Buffer Object" In OpenGL, Store things in VRam.

Constructor & Destructor Documentation

◆ VRamList() [1/7]

JGL::VRamList::VRamList ( const GLuint *  data,
const long &  length 
)

◆ VRamList() [2/7]

JGL::VRamList::VRamList ( const GLfloat *  data,
const long &  length 
)

◆ VRamList() [3/7]

JGL::VRamList::VRamList ( const Vector2 *  data,
const long &  length 
)

◆ VRamList() [4/7]

JGL::VRamList::VRamList ( const Vector3 *  data,
const long &  length 
)

◆ VRamList() [5/7]

JGL::VRamList::VRamList ( const Vector4 *  data,
const long &  length 
)

◆ ~VRamList()

JGL::VRamList::~VRamList ( )

◆ VRamList() [6/7]

JGL::VRamList::VRamList ( const VRamList rhs)

Copying around the VBO data to a new VBO like this is slow.

Pass to function by const reference or pointer always.

Here is the call graph for this function:

◆ VRamList() [7/7]

JGL::VRamList::VRamList ( )
default

Member Function Documentation

◆ GetDataF()

std::vector< GLfloat > JGL::VRamList::GetDataF ( ) const

Get VBO data back from the GPU.

This is bad because the CPU is going to wait for the transfer to finish. Has limited use other than testing.

Here is the caller graph for this function:

◆ GetDataUI()

std::vector< GLuint > JGL::VRamList::GetDataUI ( ) const
Here is the caller graph for this function:

◆ GetHandle()

GLuint JGL::VRamList::GetHandle ( ) const

◆ GetLength()

long JGL::VRamList::GetLength ( ) const

Returns the number of elements in the list.

◆ GetSize()

size_t JGL::VRamList::GetSize ( ) const

Returns the size of the data in bytes.

◆ IsFloatArray()

bool JGL::VRamList::IsFloatArray ( ) const

◆ SetData() [1/6]

void JGL::VRamList::SetData ( const GLfloat *  data,
const long &  length 
)

Replace the data of an existing VBO in it's entirety.

Must be same type. "length" refers to the number of elements in data. Not the number of bytes.

◆ SetData() [2/6]

void JGL::VRamList::SetData ( const GLuint *  data,
const long &  length 
)

◆ SetData() [3/6]

void JGL::VRamList::SetData ( const Vector2 *  data,
const long &  length 
)

◆ SetData() [4/6]

void JGL::VRamList::SetData ( const Vector2i *  data,
const long &  length 
)

◆ SetData() [5/6]

void JGL::VRamList::SetData ( const Vector3 *  data,
const long &  length 
)

◆ SetData() [6/6]

void JGL::VRamList::SetData ( const Vector4 *  data,
const long &  length 
)

◆ UpdateData() [1/6]

void JGL::VRamList::UpdateData ( const GLfloat *  data,
const long &  offset,
const long &  length 
)

Update only a portion of the data in a VBO.

Must be same type. "length" refers to the number of elements in data. Not the number of bytes. "offset" refers the number of Typename T into the buffer the data you want to change is. For ex, offset 0 and length of 1 overwrites the first value. Offset 1 the second etc

◆ UpdateData() [2/6]

void JGL::VRamList::UpdateData ( const GLuint *  data,
const long &  offset,
const long &  length 
)

◆ UpdateData() [3/6]

void JGL::VRamList::UpdateData ( const Vector2 *  data,
const long &  offset,
const long &  length 
)

◆ UpdateData() [4/6]

void JGL::VRamList::UpdateData ( const Vector2i *  data,
const long &  offset,
const long &  length 
)

◆ UpdateData() [5/6]

void JGL::VRamList::UpdateData ( const Vector3 *  data,
const long &  offset,
const long &  length 
)

◆ UpdateData() [6/6]

void JGL::VRamList::UpdateData ( const Vector4 *  data,
const long &  offset,
const long &  length 
)

The documentation for this class was generated from the following files: