Remove unused code
This commit is contained in:
parent
8e27c80e1f
commit
277c46908d
28
kitty/gl.h
28
kitty/gl.h
@ -536,33 +536,6 @@ GetTexImage(PyObject UNUSED *self, PyObject *args) {
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
static PyObject*
|
||||
NamedBufferData(PyObject UNUSED *self, PyObject *args) {
|
||||
int usage;
|
||||
unsigned long size, target;
|
||||
PyObject *address;
|
||||
if (!PyArg_ParseTuple(args, "kkO!i", &target, &size, &PyLong_Type, &address, &usage)) return NULL;
|
||||
void *data = PyLong_AsVoidPtr(address);
|
||||
if (data == NULL) { PyErr_SetString(PyExc_TypeError, "Not a valid data pointer"); return NULL; }
|
||||
Py_BEGIN_ALLOW_THREADS;
|
||||
#ifdef glNamedBufferData
|
||||
#ifdef __APPLE__
|
||||
if(false) {
|
||||
#else
|
||||
if(GLEW_VERSION_4_5) {
|
||||
#endif
|
||||
glNamedBufferData(target, size, data, usage);
|
||||
} else {
|
||||
glBindBuffer(GL_TEXTURE_BUFFER, target); glBufferData(GL_TEXTURE_BUFFER, size, data, usage); glBindBuffer(GL_TEXTURE_BUFFER, 0);
|
||||
}
|
||||
#else
|
||||
glBindBuffer(GL_TEXTURE_BUFFER, target); glBufferData(GL_TEXTURE_BUFFER, size, data, usage); glBindBuffer(GL_TEXTURE_BUFFER, 0);
|
||||
#endif
|
||||
Py_END_ALLOW_THREADS;
|
||||
CHECK_ERROR;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
static PyObject*
|
||||
GetBufferSubData(PyObject UNUSED *self, PyObject *args) {
|
||||
unsigned long size, target, offset;
|
||||
@ -825,7 +798,6 @@ int add_module_gl_constants(PyObject *module) {
|
||||
METH(CopyImageSubData, METH_VARARGS) \
|
||||
METH(TexSubImage3D, METH_VARARGS) \
|
||||
METH(GetTexImage, METH_VARARGS) \
|
||||
METH(NamedBufferData, METH_VARARGS) \
|
||||
METH(GetBufferSubData, METH_VARARGS) \
|
||||
METH(BlendFunc, METH_VARARGS) \
|
||||
METH(Finish, METH_NOARGS) \
|
||||
|
||||
@ -23,9 +23,9 @@ from .fast_data_types import (
|
||||
glDeleteShader, glDeleteTexture, glEnableVertexAttribArray, glGenBuffers,
|
||||
glGenTextures, glGenVertexArrays, glGetAttribLocation, glGetBufferSubData,
|
||||
glGetIntegerv, glGetProgramInfoLog, glGetProgramiv, glGetShaderInfoLog,
|
||||
glGetShaderiv, glGetUniformLocation, glLinkProgram, glNamedBufferData,
|
||||
glPixelStorei, glShaderSource, glTexBuffer, glTexParameteri,
|
||||
glTexStorage3D, glTexSubImage3D, glUseProgram, glVertexAttribDivisor,
|
||||
glGetShaderiv, glGetUniformLocation, glLinkProgram, glPixelStorei,
|
||||
glShaderSource, glTexBuffer, glTexParameteri, glTexStorage3D,
|
||||
glTexSubImage3D, glUseProgram, glVertexAttribDivisor,
|
||||
glVertexAttribPointer, replace_or_create_buffer
|
||||
)
|
||||
from .fonts.render import render_cell
|
||||
@ -287,7 +287,7 @@ class ShaderProgram:
|
||||
|
||||
def send_vertex_data(self, name, data, usage=GL_STATIC_DRAW):
|
||||
bufid = self.buffers[name]
|
||||
glNamedBufferData(bufid, sizeof(data), addressof(data), usage)
|
||||
buffer_manager.set_data(bufid, data, usage=usage)
|
||||
|
||||
def __hash__(self) -> int:
|
||||
return self.program_id
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user