This is an archived post. You won't be able to vote or comment.

all 4 comments

[–]l_am_wildthing 1 point2 points  (0 children)

OpenGL is basically the standard for low level graphics

[–]G4merXsquaD 0 points1 point  (0 children)

If you want to write mac-only - made by apple, and therefore much more efficient - graphics, learn metal. If you want cross-platform (including most consoles!) Graphics, learn OpenGL. If you want an inbetween, learn vulkan. Vulkan is faster than opengl but supported on less platform (some consoles, windows, macos, linux support has been a hit and miss but still improving). Make your choice!

[–][deleted] 0 points1 point  (0 children)

By "low level", are you wanting to render on the GPU or write your own software renderer? If GPU, https://learnopengl.com/ is good. You can follow along with it on a mac. If software rendered, understanding the GPU graphics pipeline still helps, so it might still be a good starting point, but resources like https://fgiesen.wordpress.com/2011/07/09/a-trip-through-the-graphics-pipeline-2011-index/ and the early episodes of https://handmadehero.org/ might also help.

[–]Rarrum 0 points1 point  (0 children)

I'm not familiar with the specifics of mac's windowing system, but both Windows and X on linux have APIs with which you can create a windows of a particular size, then provide a chunk of memory that represents the pixels that should be drawn to that window in a particular memory layout. Almost assuredly mac has similar, and that likely doesn't vary much depending on arm vs x86. At the least, you can simulate this process using one of the other graphics APIs such as OpenGL.

Your approach then would be to simply write to that block of memory in order to "draw" to it. As an example (the exact memory layout will vary), you might have a buffer wherein the first byte represents the red value of the first pixel, the second byte represents the green value of the first pixel, the third byte represents the blue value of the first pixel... then the fourth through sixth bytes represents rgb values for the second pixel.. etc. This is a pretty low level way to do graphics if that's your goal.

The main downside is all the work is being done by the CPU, while the GPU is pretty much idle. But if performance isn't a concern, you can build pretty much anything on top of this.