mirror of
https://github.com/blawar/GLideN64.git
synced 2024-07-04 10:03:36 +00:00
Add target parameter to PBOBinder struct.
This commit is contained in:
parent
905385f251
commit
778d1e38d5
|
@ -1060,7 +1060,7 @@ void RDRAMtoFrameBuffer::CopyFromRDRAM( u32 _address, bool _bUseAlpha)
|
|||
m_pTexture->height = height;
|
||||
const u32 dataSize = width*height*4;
|
||||
#ifndef GLES2
|
||||
PBOBinder binder(m_PBO);
|
||||
PBOBinder binder(GL_PIXEL_UNPACK_BUFFER, m_PBO);
|
||||
glBufferData(GL_PIXEL_UNPACK_BUFFER, dataSize, NULL, GL_DYNAMIC_DRAW);
|
||||
GLubyte* ptr = (GLubyte*)glMapBuffer(GL_PIXEL_UNPACK_BUFFER, GL_WRITE_ONLY);
|
||||
#else
|
||||
|
|
|
@ -80,13 +80,14 @@ private:
|
|||
|
||||
struct PBOBinder {
|
||||
#ifndef GLES2
|
||||
PBOBinder(GLuint _PBO)
|
||||
PBOBinder(GLenum _target, GLuint _PBO) : m_target(_target)
|
||||
{
|
||||
glBindBuffer(GL_PIXEL_UNPACK_BUFFER, _PBO);
|
||||
glBindBuffer(m_target, _PBO);
|
||||
}
|
||||
~PBOBinder() {
|
||||
glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0);
|
||||
glBindBuffer(m_target, 0);
|
||||
}
|
||||
GLenum m_target;
|
||||
#else
|
||||
PBOBinder(GLubyte* _ptr) : ptr(_ptr) {}
|
||||
~PBOBinder() { free(ptr); }
|
||||
|
|
|
@ -133,7 +133,7 @@ void NoiseTexture::update()
|
|||
if (dataSize == 0)
|
||||
return;
|
||||
#ifndef GLES2
|
||||
PBOBinder binder(m_PBO);
|
||||
PBOBinder binder(GL_PIXEL_UNPACK_BUFFER, m_PBO);
|
||||
glBufferData(GL_PIXEL_UNPACK_BUFFER, dataSize, NULL, GL_DYNAMIC_DRAW);
|
||||
GLubyte* ptr = (GLubyte*)glMapBuffer(GL_PIXEL_UNPACK_BUFFER, GL_WRITE_ONLY);
|
||||
#else
|
||||
|
|
Loading…
Reference in New Issue
Block a user