6
6
7
7
#include "doc/sdl2_video_doc.h"
8
8
9
- #include "texture.c"
10
- #include "renderer_image.c"
11
-
9
+ /* Declarations */
12
10
static PyTypeObject pgRenderer_Type ;
13
11
14
12
static PyTypeObject pgTexture_Type ;
15
13
16
14
static PyTypeObject pgImage_Type ;
17
15
16
+ #define pgRenderer_Check (x ) \
17
+ (PyObject_IsInstance((x), (PyObject *)&pgRenderer_Type))
18
+
19
+ #define pgTexture_Check (x ) \
20
+ (PyObject_IsInstance((x), (PyObject *)&pgTexture_Type))
21
+
22
+ #define pgImage_Check (x ) (PyObject_IsInstance((x), (PyObject *)&pgImage_Type))
23
+
18
24
#define RENDERER_ERROR_CHECK (x ) \
19
25
if (x < 0) { \
20
26
return RAISE(pgExc_SDLError, SDL_GetError()); \
@@ -26,6 +32,13 @@ static PyTypeObject pgImage_Type;
26
32
return -1; \
27
33
}
28
34
35
+ static void
36
+ texture_renderer_draw (pgTextureObject * self , PyObject * area , PyObject * dest );
37
+
38
+ static void
39
+ image_renderer_draw (pgImageObject * self , PyObject * area , PyObject * dest );
40
+
41
+ /* Renderer implementation */
29
42
static PyObject *
30
43
from_window (PyTypeObject * cls , PyObject * args , PyObject * kwargs )
31
44
{
@@ -663,6 +676,21 @@ renderer_dealloc(pgRendererObject *self, PyObject *_null)
663
676
Py_TYPE (self )-> tp_free (self );
664
677
}
665
678
679
+ /* Texture implementation */
680
+ static void
681
+ texture_renderer_draw (pgTextureObject * self , PyObject * area , PyObject * dest )
682
+ {
683
+ ; // TODO MightyJosip Implement with Texture class
684
+ }
685
+
686
+ /* Image implementation */
687
+ static void
688
+ image_renderer_draw (pgImageObject * self , PyObject * area , PyObject * dest )
689
+ {
690
+ ; // TODO MightyJosip Implement with Image class
691
+ }
692
+
693
+ /* Module definition */
666
694
static PyMethodDef renderer_methods [] = {
667
695
{"draw_point" , (PyCFunction )renderer_draw_point ,
668
696
METH_VARARGS | METH_KEYWORDS , DOC_SDL2_VIDEO_RENDERER_DRAWPOINT },
@@ -726,10 +754,12 @@ static PyGetSetDef image_getset[] = {{NULL, 0, NULL, NULL, NULL}};
726
754
static PyTypeObject pgRenderer_Type = {
727
755
PyVarObject_HEAD_INIT (NULL , 0 ).tp_name = "pygame._renderer.Renderer" ,
728
756
.tp_basicsize = sizeof (pgRendererObject ),
729
- //.tp_dealloc = (destructor)renderer_dealloc,
730
- .tp_doc = DOC_SDL2_VIDEO_RENDERER , .tp_methods = renderer_methods ,
731
- //.tp_init = (initproc)renderer_init,
732
- .tp_new = PyType_GenericNew , .tp_getset = renderer_getset };
757
+ .tp_dealloc = (destructor )renderer_dealloc ,
758
+ .tp_doc = DOC_SDL2_VIDEO_RENDERER ,
759
+ .tp_methods = renderer_methods ,
760
+ .tp_init = (initproc )renderer_init ,
761
+ .tp_new = PyType_GenericNew ,
762
+ .tp_getset = renderer_getset };
733
763
734
764
static PyTypeObject pgTexture_Type = {
735
765
PyVarObject_HEAD_INIT (NULL , 0 ).tp_name = "pygame._renderer.Texture" ,
0 commit comments