r/ProgrammingLanguages • u/ThomasMertes • 29d ago
How programming languages approach graphics
Many general-purpose languages delegate graphics to third-party libraries (like SDL, Raylib, or OpenGL). Seed7 integrates portable 2-D graphics right into its standard library. This IMHO improves portability. I also thought about introducing operators / statements to do graphics, but until now I don't use operators or statements to do graphics.
29
Upvotes
View all comments
Show parent comment
2
u/ThomasMertes 29d ago
Yes, if you use 2-D graphics.
If you write a graphic program with X11, GDI, GL or Vulkan you probably need at least 100 lines of code to set up the graphic library, handle events, define callback functions, etc. Did you know that REDRAW / EXPOSE events exist, which tell the program: Some part of your window has been erased. In case of these events the program needs to redraw the erased parts. Imagine if that happens to data in your program: "Some of your data is now garbage, you need to restore it now." Graphic libraries think that this is normal.
The Seed7 graphics library does all that background work for you. So the Seed7 graphics library is not only portable, but it removes some burden from the shoulders as well.
For this reason Seed7 supports 2-D graphics, an area which has not progressed so fast. This way Seed7 is well suited to write retro games (these games run in the browser - just click on them).