RFR: 8092272: [D3D 3D] Need a robust 3D states management for texture [v2]
Michael Strauß
mstrauss at openjdk.org
Mon Nov 13 01:26:07 UTC 2023
On Fri, 10 Nov 2023 23:33:12 GMT, Nir Lisker <nlisker at openjdk.org> wrote:
>> modules/javafx.graphics/src/main/native-prism-d3d/D3DPhongMaterial.h line 41:
>>
>>> 39: self_illumination,
>>> 40: num_map_types
>>> 41: };
>>
>> 1. Types generally seem to use PascalCase in this library, and constants UPPER_CASE or CamelCase.
>> 2. You can use `enum class` to prevent the constants from polluting the global namespace.
>> 3. The underlying type doesn't need to be specified, it's `int` by default. You're casting it to `int` in `D3DMeshView.cc` anyway.
>
> About 2, I tried that initially and got into problems iterating over the enum in `D3DMeshView.cc` line 293. How would you perform the iteration?
You're right, there's no implicit conversion from scoped enums to integers. While one could get very creative with C++, maybe just using an unscoped enum is easier. You might want to prefix the constants with `MT_` or something like that.
-------------
PR Review Comment: https://git.openjdk.org/jfx/pull/1281#discussion_r1390543995
More information about the openjfx-dev
mailing list