Skip to content

Commit

Permalink
Add interface for _sdl2.video classes
Browse files Browse the repository at this point in the history
  • Loading branch information
MightyJosip committed Feb 3, 2025
1 parent 363fa59 commit afccd4b
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 41 deletions.
31 changes: 28 additions & 3 deletions src_c/renderer.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,24 @@

#include "doc/sdl2_video_doc.h"

#include "texture.c"
#include "renderer_image.c"

static PyTypeObject pgRenderer_Type;

static PyTypeObject pgTexture_Type;

static PyTypeObject pgImage_Type;

static PyMethodDef renderer_methods[] = {{NULL, NULL, 0, NULL}};

static PyGetSetDef renderer_getset[] = {{NULL, 0, NULL, NULL, NULL}};

static PyMethodDef texture_methods[] = {{NULL, NULL, 0, NULL}};

static PyGetSetDef texture_getset[] = {{NULL, 0, NULL, NULL, NULL}};

static PyMethodDef image_methods[] = {{NULL, NULL, 0, NULL}};

static PyGetSetDef image_getset[] = {{NULL, 0, NULL, NULL, NULL}};

static PyTypeObject pgRenderer_Type = {
PyVarObject_HEAD_INIT(NULL, 0).tp_name = "pygame._renderer.Renderer",
.tp_basicsize = sizeof(pgRendererObject),
Expand All @@ -23,6 +32,22 @@ static PyTypeObject pgRenderer_Type = {
//.tp_init = (initproc)renderer_init,
.tp_new = PyType_GenericNew, .tp_getset = renderer_getset};

static PyTypeObject pgTexture_Type = {
PyVarObject_HEAD_INIT(NULL, 0).tp_name = "pygame._renderer.Texture",
.tp_basicsize = sizeof(pgTextureObject),
//.tp_dealloc = (destructor)texture_dealloc,
.tp_doc = DOC_SDL2_VIDEO_TEXTURE, .tp_methods = texture_methods,
//.tp_init = (initproc)texture_init,
.tp_new = PyType_GenericNew, .tp_getset = texture_getset};

static PyTypeObject pgImage_Type = {
PyVarObject_HEAD_INIT(NULL, 0).tp_name = "pygame._renderer.Image",
.tp_basicsize = sizeof(pgImageObject),
//.tp_dealloc = (destructor)image_dealloc,
.tp_doc = DOC_SDL2_VIDEO_IMAGE, .tp_methods = image_methods,
//.tp_init = (initproc)image_init,
.tp_new = PyType_GenericNew, .tp_getset = image_getset};

static PyMethodDef _renderer_methods[] = {{NULL, NULL, 0, NULL}};

MODINIT_DEFINE(_renderer)
Expand Down
19 changes: 0 additions & 19 deletions src_c/renderer_image.c

This file was deleted.

19 changes: 0 additions & 19 deletions src_c/texture.c

This file was deleted.

0 comments on commit afccd4b

Please sign in to comment.