Browse Source

Add Window::activateContext().

tags/v2.0.0
Andrew Belt 3 years ago
parent
commit
8de2c36de3
2 changed files with 6 additions and 0 deletions
  1. +1
    -0
      include/window/Window.hpp
  2. +5
    -0
      src/window/Window.cpp

+ 1
- 0
include/window/Window.hpp View File

@@ -71,6 +71,7 @@ struct Window {
void setSize(math::Vec size);
void run();
void step();
void activateContext();
/** Takes a screenshot of the screen and saves it to a PNG file. */
void screenshot(const std::string& screenshotPath);
/** Saves a PNG image of all modules to `screenshotsDir/<plugin slug>/<module slug>.png`.


+ 5
- 0
src/window/Window.cpp View File

@@ -517,6 +517,11 @@ void Window::step() {
}


void Window::activateContext() {
glfwMakeContextCurrent(win);
}


static void flipBitmap(uint8_t* pixels, int width, int height, int depth) {
for (int y = 0; y < height / 2; y++) {
int flipY = height - y - 1;


Loading…
Cancel
Save