Clear noth the front and back buffers on startup
This commit is contained in:
parent
627225def7
commit
28c51b11ef
@ -13,7 +13,7 @@ from .config import load_config
|
||||
from .constants import appname, str_version, config_dir, viewport_size
|
||||
from .tabs import TabManager
|
||||
from .shaders import GL_VERSION
|
||||
from .fast_data_types import glewInit, enable_automatic_opengl_error_checking
|
||||
from .fast_data_types import glewInit, enable_automatic_opengl_error_checking, glClear, glClearColor, GL_COLOR_BUFFER_BIT
|
||||
import glfw
|
||||
import glfw_constants
|
||||
|
||||
@ -43,6 +43,16 @@ def setup_opengl():
|
||||
glfw.glfwWindowHint(glfw_constants.GLFW_SAMPLES, 0)
|
||||
|
||||
|
||||
def clear_buffers(window, opts):
|
||||
bg = opts.background
|
||||
glClearColor(bg.red / 255, bg.green / 255, bg.blue / 255, 1)
|
||||
glfw.glfwSwapInterval(0)
|
||||
glClear(GL_COLOR_BUFFER_BIT)
|
||||
glfw.glfwSwapBuffers(window)
|
||||
glClear(GL_COLOR_BUFFER_BIT)
|
||||
glfw.glfwSwapInterval(1)
|
||||
|
||||
|
||||
def run_app(opts, args):
|
||||
setup_opengl()
|
||||
window = glfw.glfwCreateWindow(
|
||||
@ -53,7 +63,7 @@ def run_app(opts, args):
|
||||
try:
|
||||
glfw.glfwMakeContextCurrent(window)
|
||||
glewInit()
|
||||
glfw.glfwSwapInterval(1)
|
||||
clear_buffers(window, opts)
|
||||
tabs = TabManager(window, opts, args)
|
||||
tabs.start()
|
||||
try:
|
||||
|
||||
@ -18,7 +18,7 @@ import glfw
|
||||
import glfw_constants
|
||||
from .child import Child
|
||||
from .constants import viewport_size, shell_path, appname, set_tab_manager, tab_manager, wakeup, cell_size
|
||||
from .fast_data_types import glViewport, glBlendFunc, GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, glClearColor, glClear, GL_COLOR_BUFFER_BIT
|
||||
from .fast_data_types import glViewport, glBlendFunc, GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA
|
||||
from .fonts import set_font_family
|
||||
from .borders import Borders, BordersProgram
|
||||
from .char_grid import cursor_shader, cell_shader
|
||||
@ -135,9 +135,6 @@ class TabManager(Thread):
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)
|
||||
self.sprites.do_layout(cell_size.width, cell_size.height)
|
||||
self.queue_action(self.active_tab.new_window, False)
|
||||
bg = opts.background
|
||||
glClearColor(bg.red / 255, bg.green / 255, bg.blue / 255, 1)
|
||||
glClear(GL_COLOR_BUFFER_BIT)
|
||||
|
||||
def signal_received(self):
|
||||
try:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user