day-night loop, dynamic skybox, clock on debug panel
This commit is contained in:
@@ -127,6 +127,10 @@ int Window::initialize(DisplaySettings& settings){
|
||||
glfwSetWindowMonitor(window, monitor, 0, 0, mode->width, mode->height, GLFW_DONT_CARE);
|
||||
}
|
||||
glfwSwapInterval(settings.swapInterval);
|
||||
const GLubyte* vendor = glGetString(GL_VENDOR);
|
||||
const GLubyte* renderer = glGetString(GL_RENDERER);
|
||||
std::cout << "GL Vendor: " << (char*)vendor << std::endl;
|
||||
std::cout << "GL Renderer: " << (char*)renderer << std::endl;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -134,6 +138,10 @@ void Window::clear() {
|
||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||
}
|
||||
|
||||
void Window::clearDepth() {
|
||||
glClear(GL_DEPTH_BUFFER_BIT);
|
||||
}
|
||||
|
||||
void Window::setBgColor(glm::vec3 color) {
|
||||
glClearColor(color.r, color.g, color.b, 1.0f);
|
||||
}
|
||||
@@ -252,6 +260,7 @@ DisplaySettings* Window::getSettings() {
|
||||
|
||||
ImageData* Window::takeScreenshot() {
|
||||
ubyte* data = new ubyte[width * height * 3];
|
||||
glPixelStorei(GL_PACK_ALIGNMENT, 1);
|
||||
glReadPixels(0, 0, width, height, GL_RGB, GL_UNSIGNED_BYTE, data);
|
||||
return new ImageData(ImageFormat::rgb888, width, height, data);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user