Reviewing Getter and Setter
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 20/100
Línea de trabajo
No files or tests are named. Start by reviewing the current wrapper APIs and getter/setter macros for Image, Texture, Model, and AutomationEventList, then determine whether ownership, dependent fields, spans, and public members have an agreed design; done requires a specific, accepted scope rather than the alternatives listed here.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
While rewriting the code for my own proposes, I encounter that everything can be get and set, at first this not bad, but doesn't make always sense, for example: all the owning pointers or resources with depending member like width and height in Image.
Maybe we can prevent the user from setting depended members or changing pointer to leak memory/ownership.
What happens when someone tempers with SetMaterialCount in Model but didn't update Materials.
For example, Image:
CONST_GETTER(void*, Data, data)
GETTER(int, Width, width)
GETTER(int, Height, height)
GETTER(int, Mipmaps, mipmaps)
GETTER(int, Format, format)
So the Image can only been loaded or manipulated with operations like Format.
Not sure about something like Texture, is resetting the id ok (?) Only set the id via Load or from ::Texture (?)
There is also the possibility for using something like std::span for arrays.
/// Model
GETTERSETTER(int, MeshCount, meshCount)
GETTERSETTER(int, MaterialCount, materialCount)
SPAN_GETTER(::Mesh, Meshes, meshes, meshCount)
SPAN_GETTER(::Material, Materials, materials, materialCount) ///< std::span{materials, materialCount}
/// AutomationEventList
GETTERSETTER(unsigned int, Capacity, capacity)
GETTERSETTER(unsigned int, Count, count)
SPAN_GETTER(AutomationEvent, Events, events, capacity)
While the classes still can been converted to (C) raylib structs and "loaded" from raylibs structs, the wrapper interface itself can been a little bit more robust, and if someone really want to tamper with the data, it still can been done via (explicit) casting. or using the public members. (I personally thinking about, using composition for the classes and explicit casting, so the data is no more public)
- Lenguaje dominante
- C++
- Estrellas
- 965
- Forks
- 120
- Merge medio
- 1 d 17 h
- PR fusionados (30 d)
- 7
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de RobLoach/raylib-cpp
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
RobLoach/raylib-cpp#425 ·
-
Dificultad 3/5 1-2 días Aptitud para principiantes 58/100
RobLoach/raylib-cpp#434 ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
RobLoach/raylib-cpp#427 ·
-
Code genAbierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 30/100
RobLoach/raylib-cpp#415 · 1 comentario ·
-
Dificultad 3/5 1-2 días Aptitud para principiantes 45/100
RobLoach/raylib-cpp#370 · 1 comentario ·
Todos los issues de RobLoach/raylib-cpp
Issues similares
-
area/ysql kind/bug priority/medium
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
yugabyte/yugabyte-db#34552 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 1/5 Menos de una hora Aptitud para principiantes 94/100
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
Los mantenedores suelen responder en 1 día
-
ai_p2
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
ClickHouse/ClickHouse#123351 ·
Los mantenedores suelen responder en 1 día