r/GraphicsProgramming • • Aug 23 '26

Question Style of graphics samples

Hey everyone,

I have been wondering which way is the best to showcase graphics samples. DirectX samples write their samples which calls functions and helper functions from multiple files. this approach is easy to write and extend but it makes reading the code hard. Yes most editors and IDEs help but it's still hard to seen everything at one place.

The second style is to accept some level of code duplication to make the code very easy to read and follow. I like this approach when learning a new API.

What style do you guys prefer and why.

4 Upvotes

14 comments sorted by

View all comments

Show parent comment

3

u/nichcode Aug 24 '26

I see. An example, hide the setup code from the previous samples and focus on what that sample handles. I do hope I understood your point

1

u/Still_Explorer Aug 24 '26

Yeah this is it.

2

u/nichcode Aug 24 '26

Thank you. I am looking for the best way to write my abstraction layer sample codes. What I do is not having helper functions which makes the sample fully visible and very easy to read but I don't abstract the setup code. I will fix that