[nostalgia/core/studio] Add scrolling support to TileSheetEditor
This commit is contained in:
@@ -24,8 +24,9 @@ class TileSheetPixels {
|
||||
in vec2 vPosition;
|
||||
in vec3 vColor;
|
||||
out vec3 fColor;
|
||||
uniform vec2 vScroll;
|
||||
void main() {
|
||||
gl_Position = vec4(vPosition, 0.0, 1.0);
|
||||
gl_Position = vec4(vPosition + vScroll, 0.0, 1.0);
|
||||
fColor = vColor;
|
||||
})";
|
||||
static constexpr auto FShad = R"(
|
||||
@@ -46,18 +47,18 @@ class TileSheetPixels {
|
||||
|
||||
ox::Error buildShader() noexcept;
|
||||
|
||||
void draw(bool update) noexcept;
|
||||
void draw(bool update, const ImVec2 &scroll) noexcept;
|
||||
|
||||
void initBufferSet(const NostalgiaGraphic &img, const NostalgiaPalette &pal) noexcept;
|
||||
|
||||
[[nodiscard]]
|
||||
ImVec2 pixelSize(const ImVec2 &paneSize = ImGui::GetContentRegionAvail()) const noexcept;
|
||||
|
||||
private:
|
||||
void setPixelBufferObject(unsigned vertexRow, float x, float y, Color16 color, float *vbo, GLuint *ebo) noexcept;
|
||||
|
||||
void setBufferObjects(const NostalgiaGraphic &img, const NostalgiaPalette &pal, glutils::BufferSet *bg) noexcept;
|
||||
|
||||
[[nodiscard]]
|
||||
ImVec2 pixelSize() const noexcept;
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user