mirror of
https://github.com/zoriya/ComSquare.git
synced 2026-05-27 16:21:53 +00:00
fixed misleading x and y
This commit is contained in:
@@ -22,7 +22,7 @@ int main(int argc, char **argv)
|
||||
bus.mapComponents(snes);
|
||||
int incx = 0;
|
||||
int incy = 0;
|
||||
uint32_t pixel = 0xFF0000FF;
|
||||
uint32_t pixel = 0xFFFF00FF;
|
||||
|
||||
while (!renderer.shouldExit) {
|
||||
renderer.putPixel(incy, incx++, pixel);
|
||||
|
||||
@@ -25,14 +25,14 @@ namespace ComSquare::Renderer
|
||||
this->renderer.display();
|
||||
}
|
||||
|
||||
void SFRenderer::putPixel(int x, int y, uint32_t rgba)
|
||||
void SFRenderer::putPixel(int y, int x, uint32_t rgba)
|
||||
{
|
||||
sf::Color pixels;
|
||||
pixels.r = rgba >> 24U;
|
||||
pixels.g = rgba >> 16U;
|
||||
pixels.b = rgba >> 8U;
|
||||
pixels.a = rgba >> 0U;
|
||||
this->pixelBuffer[this->videoMode.width * x + y] = pixels;
|
||||
this->pixelBuffer[this->videoMode.width * y + x] = pixels;
|
||||
}
|
||||
|
||||
SFRenderer::SFRenderer(unsigned int height, unsigned int width, int maxFPS)
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace ComSquare::Renderer
|
||||
//! @param X horizontal index.
|
||||
//! @param Y vertical index.
|
||||
//! @param rgba The color of the pixel.
|
||||
void putPixel(int x, int y, uint32_t rgba) override ;
|
||||
void putPixel(int y, int x, uint32_t rgba) override ;
|
||||
//! @brief Get the inputs from the Window
|
||||
void getEvents();
|
||||
//! @brief Constructor that return the window component of the SFML.
|
||||
|
||||
Reference in New Issue
Block a user