Dont include gl.h in glfw.c

This commit is contained in:
Kovid Goyal
2025-08-11 10:55:29 +05:30
parent bfa51daa0a
commit 96c9c557c6
4 changed files with 9 additions and 10 deletions

View File

@@ -19,7 +19,7 @@ from .child import cmdline_of_pid
from .cli import version
from .colors import theme_colors
from .constants import extensions_dir, is_macos, is_wayland, kitty_base_dir, kitty_exe, shell_path
from .fast_data_types import Color, SingleKey, current_fonts, glfw_get_system_color_theme, num_users, opengl_version_string, wayland_compositor_data
from .fast_data_types import Color, SingleKey, current_fonts, glfw_get_system_color_theme, gpu_driver_version_string, num_users, wayland_compositor_data
from .options.types import Options as KittyOpts
from .options.types import defaults, secret_options
from .options.utils import KeyboardMode, KeyDefinition
@@ -265,7 +265,7 @@ def debug_config(opts: KittyOpts, global_shortcuts: dict[str, SingleKey] | None
p(f.read().strip())
if not is_macos:
p('Running under:', green(compositor_name()))
p(green('OpenGL:'), opengl_version_string())
p(green('OpenGL:'), gpu_driver_version_string())
p(green('Frozen:'), 'True' if getattr(sys, 'frozen', False) else 'False')
p(green('Fonts:'))
for k, font in current_fonts().items():

View File

@@ -1733,7 +1733,7 @@ def terminfo_data() -> bytes:...
def wayland_compositor_data() -> Tuple[int, Optional[str]]:...
def monotonic() -> float: ...
def timed_debug_print(x: str) -> None: ...
def opengl_version_string() -> str: ...
def gpu_driver_version_string() -> str: ...
def systemd_move_pid_into_new_scope(pid: int, scope_name: str, description: str) -> str: ...
def play_desktop_sound_async(name: str, event_id: str = 'test sound', is_path: bool = False, theme_name: str = '') -> str: ...
def cocoa_play_system_sound_by_id_async(sound_id: int) -> None: ...

View File

@@ -11,7 +11,6 @@
#include "control-codes.h"
#include <structmember.h>
#include "glfw-wrapper.h"
#include "gl.h"
#ifdef __APPLE__
#include "cocoa_window.h"
#else
@@ -1703,11 +1702,6 @@ dbus_user_notification_activated(uint32_t notification_id, int type, const char*
}
#endif
static PyObject*
opengl_version_string(PyObject *self UNUSED, PyObject *args UNUSED) {
return PyUnicode_FromString(global_state.gl_version ? gl_version_string() : "");
}
static PyObject*
glfw_init(PyObject UNUSED *self, PyObject *args) {
const char* path;
@@ -2660,7 +2654,6 @@ static PyMethodDef module_methods[] = {
METHODB(cocoa_hide_other_apps, METH_NOARGS),
METHODB(cocoa_minimize_os_window, METH_VARARGS),
{"glfw_init", (PyCFunction)glfw_init, METH_VARARGS, ""},
METHODB(opengl_version_string, METH_NOARGS),
{"glfw_terminate", (PyCFunction)glfw_terminate, METH_NOARGS, ""},
{"glfw_get_physical_dpi", (PyCFunction)glfw_get_physical_dpi, METH_NOARGS, ""},
{"glfw_get_key_name", (PyCFunction)glfw_get_key_name, METH_VARARGS, ""},

View File

@@ -1224,6 +1224,11 @@ setup_os_window_for_rendering(OSWindow *os_window, Tab *tab, Window *active_wind
// Python API {{{
static PyObject*
pygpu_driver_version_string(PyObject *self UNUSED, PyObject *args UNUSED) {
return PyUnicode_FromString(global_state.gl_version ? gl_version_string() : "");
}
static bool
attach_shaders(PyObject *sources, GLuint program_id, GLenum shader_type) {
RAII_ALLOC(const GLchar*, c_sources, calloc(PyTuple_GET_SIZE(sources), sizeof(GLchar*)));
@@ -1309,6 +1314,7 @@ static PyMethodDef module_methods[] = {
M(compile_program, METH_VARARGS),
M(sprite_map_set_limits, METH_VARARGS),
MW(create_vao, METH_NOARGS),
MW(gpu_driver_version_string, METH_NOARGS),
MW(bind_vertex_array, METH_O),
MW(unbind_vertex_array, METH_NOARGS),
MW(unmap_vao_buffer, METH_VARARGS),