Reviewing Getter and Setter
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 20/100
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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)
- Ngôn ngữ chính
- C++
- Star
- 967
- Fork
- 120
- Merge trung bình
- 1 ngày 12 giờ
- Pull request đã merge (30 ngày)
- 8
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của RobLoach/raylib-cpp
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
RobLoach/raylib-cpp#425 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
RobLoach/raylib-cpp#427 ·
-
Code genĐang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 30/100
RobLoach/raylib-cpp#415 · 1 bình luận ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
RobLoach/raylib-cpp#370 · 1 bình luận ·
-
SDF Font SupportĐang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 55/100
RobLoach/raylib-cpp#366 · 3 bình luận ·
Tất cả issue của RobLoach/raylib-cpp
Issue tương tự
-
libasr headers?Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug iOS 🍎 ui/ux
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
MerginMaps/mobile#4744 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Component: Ruby Type: bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 3 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
kokkos/kokkos-kernels#3328 ·
Maintainer thường phản hồi trong vòng 1 ngày