mirror of
https://github.com/blawar/GLideN64.git
synced 2024-07-07 03:13:49 +00:00
ColorBufferReader: move m_pixelData to base class. Code cleanup.
This commit is contained in:
parent
5ad454cebf
commit
ff0d0d59b4
|
@ -1,7 +1,7 @@
|
|||
#pragma once
|
||||
#include <vector>
|
||||
#include <Types.h>
|
||||
|
||||
struct CachedTexture;
|
||||
#include <Textures.h>
|
||||
|
||||
namespace graphics {
|
||||
|
||||
|
@ -10,18 +10,16 @@ class ColorBufferReader
|
|||
public:
|
||||
ColorBufferReader(CachedTexture * _pTexture)
|
||||
: m_pTexture(_pTexture) {
|
||||
m_pixelData.resize(m_pTexture->textureBytes);
|
||||
}
|
||||
|
||||
virtual ~ColorBufferReader() {}
|
||||
|
||||
// virtual void init() = 0;
|
||||
// virtual void initBuffers() = 0;
|
||||
// virtual void destroyBuffers() = 0;
|
||||
virtual u8 * readPixels(s32 _x0, s32 _y0, u32 _width, u32 _height, u32 _size, bool _sync) = 0;
|
||||
virtual void cleanUp() = 0;
|
||||
|
||||
protected:
|
||||
CachedTexture * m_pTexture;
|
||||
std::vector<u8> m_pixelData;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
#include <Textures.h>
|
||||
#include <Graphics/Context.h>
|
||||
#include "opengl_ColorBufferReaderWithBufferStorage.h"
|
||||
|
||||
|
@ -32,8 +31,6 @@ void ColorBufferReaderWithBufferStorage::_initBuffers()
|
|||
}
|
||||
|
||||
m_bindBuffer->bind(Parameter(GL_PIXEL_PACK_BUFFER), ObjectHandle());
|
||||
|
||||
m_pixelData.resize(m_pTexture->textureBytes);
|
||||
}
|
||||
|
||||
void ColorBufferReaderWithBufferStorage::_destroyBuffers()
|
||||
|
|
|
@ -27,7 +27,6 @@ namespace opengl {
|
|||
void* m_PBOData[_numPBO];
|
||||
u32 m_curIndex;
|
||||
GLsync m_fence[_numPBO];
|
||||
std::vector<u8> m_pixelData;
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
#include <Textures.h>
|
||||
#include <Graphics/Context.h>
|
||||
#include "opengl_ColorBufferReaderWithPixelBuffer.h"
|
||||
|
||||
|
@ -38,8 +37,6 @@ void ColorBufferReaderWithPixelBuffer::_initBuffers()
|
|||
glBufferData(GL_PIXEL_PACK_BUFFER, m_pTexture->textureBytes, nullptr, GL_DYNAMIC_READ);
|
||||
}
|
||||
m_bindBuffer->bind(Parameter(GL_PIXEL_PACK_BUFFER), ObjectHandle());
|
||||
|
||||
m_pixelData.resize(m_pTexture->textureBytes);
|
||||
}
|
||||
|
||||
u8 * ColorBufferReaderWithPixelBuffer::readPixels(s32 _x0, s32 _y0, u32 _width, u32 _height, u32 _size, bool _sync)
|
||||
|
|
|
@ -24,7 +24,6 @@ private:
|
|||
static const int _numPBO = 3;
|
||||
GLuint m_PBO[_numPBO];
|
||||
u32 m_curIndex;
|
||||
std::vector<u8> m_pixelData;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user