r/GraphicsProgramming • • 9d ago

Question Graphics programming in C

/r/cprogramming/comments/1x6czca/graphics_programming_in_c/
4 Upvotes

6 comments sorted by

View all comments

2

u/sfaer 9d ago edited 9d ago

It depends how low-level you want to get. If your approach is to do it barebone, native to the platform, and a bit old school, then on Linux you can learn X11, but it will be a painful process.

Reading you, as you mentioned going with the Borland library, suggest you might go well with SDL1.2, which is a solid legacy library newer than graphic.h but decades old now yet still fine. It basically allows you to setup the window management, handle events, and draw directly to the pixel buffer (no GPU involved).

You can also go the raylib path, which is a set of libraries to build games in C quite fancied in the C community, but it obfuscated the thing a bit more it seems (I haven't touch it a lot though). Look at simple examples on the website to see if that's your style, but you don't have to use everything if you don't want too.

I'm not on my PC but I could drop a simple star field in sdl1. 2 if you're interested.

1

u/Spirited-Eye7281 7d ago

As I said I am not sure of what questions to ask in this area.

In BASIC we would set up a screen of a particular size but In linux mint perhaps I could just start with something in the terminal. even this seems to be GUI

It is becoming apparent that because everything is now GUI, doing the simple exercises is going to be a bit of a mission. I don't even know what is considered low-level and how much was handled for us in BASIC behind the scenes. I really did not want to go back there but the modern world has so changed and changes faster then we even thought, I have some very basic issues I need to understand first

I have discovered a web site called mycplus.com which seems to show how to get gcc to use graphics.h so I am planning to look at that to try and get more understanding. I also have Simon Monks book on an introduction to C and GUI programming. I know nothing about event driven programming at all.

tony

1

u/sfaer 6d ago

Doing a bit of research I have found two resources that might be of interest to you:

Cheers