🌐
Cprogramming.com
cprogramming.com › graphics-programming.html
Graphics Programming in C and C++, OpenGL, SDL, 3d rotation - Cprogramming.com
How to begin Get the book · C tutorial C++ tutorial Game programming Graphics programming Algorithms More tutorials
🌐
Pikuma
pikuma.com › courses › learn-3d-computer-graphics-programming
Learn 3D Computer Graphics Programming from Scratch
This course is a complete immersion into the fundamentals of computer graphics! You'll learn how a software 3D engine works under the hood, and use the C programming language to write a complete software rasterizer from scratch; including textures, ...
Discussions

math - How can I implement 3d graphics rendering in C with the SDL2? - Stack Overflow
I tried implementing a C program which draws a 3d cube using SDL2. Im sorry if it is just a stupid small mistake I'm very new to C/C++. I followed this tutorial: https://youtu.be/ih20l3pJoeU. The guy from the tutorial coded everything in C++ but I tried coding it in C. More on stackoverflow.com
🌐 stackoverflow.com
3d graphics and animation
You can do anything with C More on reddit.com
🌐 r/C_Programming
48
14
July 5, 2025
Getting started with Graphics in C
Windows That's just looking for trouble. You need to solve this issue first, the primary obstacle on the way of the C programmer. More on reddit.com
🌐 r/C_Programming
51
62
April 25, 2023
Can graphics be build from scratch using only C? - Stack Overflow
And spanning this segment over ... point in it). Knowing that now, I ask you, is there any way to show on screen (create graphics) of this geometrical entities (and even 2d gemological figure (rect, circle and so on...) and furthermore more complex one, like 3d objects) only ... More on stackoverflow.com
🌐 stackoverflow.com
🌐
GitHub
paroj.github.io › gltut
Learning Modern 3D Graphics Programming
Topics of Interest · C. History of PC Graphics Hardware · Voodoo Magic · Dynamite Combiners · Vertices and Registers · Programming at Last · Dependency · Modern Unification · D. Getting Started with OpenGL · Manual Usage · List of Figures · 1. Position Vectors ·
🌐
3dcpptutorials
3dcpptutorials.sk
3D C/C++ tutorials - Home
3D graphics tutorials programming using C/C++ language and Win32/MFC library. OpenGL 1.5/2.1/3.3 + GLSL 1.2/3.3 vertex and fragment (pixel) shaders, software rendering and ray tracing in Visual Studio and Dev-C++. Tutorial source code download.
🌐
NxtWave
ccbp.in › blog › articles › graphics-program-in-c
Graphics Program in C: Libraries, Code & Examples
Computer graphics programs in C allow developers to create visual elements such as shapes, lines, and images using libraries like OpenGL, Allegro, and GDI. These programs make graphics in C more versatile, enabling developers to design both ...
🌐
Thiyagaraaj
thiyagaraaj.com › home › tutorials › computer graphics programs using c programming › 3d rotation program using c programming
3D Rotation Program Using C Programming - Thiyagaraaj.com
June 30, 2026 - We discussed the concept of 3D rotation and how to calculate the new coordinates after rotation. The program allows users to input the initial position of the 3D bar and the rotation angle.
Find elsewhere
🌐
IIES
iies.in › home › about iies › iies vision
Graphics Programming in C: Complete Beginner’s Guide
April 10, 2026 - Graphics programming in C enables ... control. Using powerful C programming graphics libraries like SDL and OpenGL, developers can draw shapes, handle animations, process pixels, and build both 2D and 3D experiences....
Price: $$$
Address: No 80, Ahad Pinnacle, Ground Floor, 5th Main, 2nd Cross, 5th Block, Koramangala Industrial Area, 560095, Bangalore
🌐
Thiyagaraaj
thiyagaraaj.com › home › tutorials › computer graphics programs using c programming › 3d translation program using c programming
3D Translation Program Using C Programming - Thiyagaraaj.com
June 30, 2026 - The user is prompted to enter the coordinates of the initial rectangle, and the midpoint and depth are calculated accordingly. The draw() function is then called to display the original 3D rectangle. After that, the screen is cleared, and the trans() function is called to display the translated 3D rectangle. This C program demonstrates a basic 3D Translation using the Turbo C graphics library.
🌐
Sankalandtech
sankalandtech.com › Tutorials › C › graphics-c.html
Graphics in C programming.
Graphics Program in C: Graphics programs in C language include libraries like GDI, OpenGL or Allegro for creating 2D and 3D graphics, games and multimedia applications. A basic understanding of programming concepts with a development environment such as Code::Blocks or Visual Studio is required.
🌐
Samsung Developer
developer.samsung.com › smarttv › develop › extension-libraries › nacl › sample-based-tutorials › 3d-graphics-in-cplusplus.html
3D Graphics in C++ | Samsung Developer
The DidChangeView() function is called whenever a viewport is created or changed, and it provides information about the viewport, such as its size and location. In the DidChangeView() function, retrieve the device scale and size, initialize OpenGL if necessary, and create the rendering context. Compile and link the shaders to the graphic program, initialize the buffers, and start the rendering loop.
🌐
Techcrashcourse
techcrashcourse.com › 2015 › 08 › c-program-draw-3d-bar-graph-using-graphics.html
C Program to Draw 3D Bar Graph Using C Graphics
C graphics programs to draw 3D bar graph on screen using graphics. It uses bar3d function of graphics.h header file.
Top answer
1 of 1
1

Supposing you've handled your global bariables in a more sensible way than written in quiestion, problems I've noticed so far:

  • DrawTriangle passes 3 points to SDL_RenderDrawLines. To draw a triangle, you have to draw 3 lines, and each line consists of 2 points, so total number of points in triangle is 6:
    SDL_Point points[] = {
        {x1, y1}, {x2, y2},
        {x2, y2}, {x3, y3},
        {x3, y3}, {x1, y1},
    };


    int ret = SDL_RenderDrawLines(p_renderer, &points, sizeof(points)/sizeof(points[0]));
  • in render, you iterate over sizeof(meshCube.tris), but sizeof of any pointer type is sizeof(void*) (e.g. 8 or 4 or 32bit system). You need to save number of vertices, e.g. add int num_tris to your mesh structure and fill it with meshCube.num_tris = sizeof(cubeTris) / sizeof(cubeTris[0]); in your window_init, where cubeTris is not a pointer but an actual array

  • you set tris as pointer to temporary array of triangles. When you render, this array may be stomped already. You have to either allocate space for that data or set it as global/static. Declaring it as static triangle cubeTris[] = { .... } would suffice

As a side note, with more-or-less modern C you don't need true/false defines, as we have #include <stdbool.h> since C99. Also note that in C, in contrast to C++, void foo() is not function that takes no arguments but rather function that takes unspecified number of arguments; function thaking no arguments would be void foo(void). [this should no longer be true with recent C2x, which is to be released "soon" as C23]

🌐
Reddit
reddit.com › r/c_programming › getting started with graphics in c
r/C_Programming on Reddit: Getting started with Graphics in C
April 25, 2023 -

I just got into programming with C (I have a pretty good amount of experience in other languages) and I am trying to start using graphics. This however, has proved quite the challenge. I can't seem to find a tutorial that covers everything when getting libraries to work with C. They are always like "Oh, just go and download MinGW32 and then you need to download GLUT also." But then never explain how to actually install both of those. Then when you look up tutorials for those they don't work with the original tutorial you were following. I see tons of people saying, "Oh, just go use SDL" but does not actually explain how to start using it.

If anyone could provide a detailed step by step guide or point me in the direction of a good tutorial that would be much appreciated.

Additionally, I am using Visual Code Studio on Windows 10

🌐
Salt by SuperCarers
salt.supercarers.com › home › c programming brings 3d models alive
C Programming Brings 3D Models Alive — Ground-Level Views | Salt by SuperCarers
June 30, 2026 - For example, you can use the OpenGL library to create a window and draw simple 3D shapes like lines, triangles, and rectangles. To create a 3D model in C, you’ll need to define the vertices, edges, and faces that make up the model.
🌐
Medium
medium.com › @ohermans1 › start-programming-in-3d-a-beginners-guide-to-c-graphics-55acaf64ee41
Start Programming in 3D: A Beginners Guide to C++ Graphics | by Ollie | Medium
February 11, 2023 - The first step to 3D graphics programming is getting familiar with the different graphics libraries available. A graphics library is a collection of code and instructions used to access, manipulate, and display 3D objects.
Top answer
1 of 3
3

Yes you can do your own rendering engine (just google rasterization) in C alone without any libs however to output gfx to screen (or any other device) You have to interface with device and here OS/platform stuff goes in. I assume PC (x86)...

For example in old MS-DOS you could use BIOS (with few lines of inline assembly) and or use direct in,out functions (yes there where time that in,out was in C) however in nowadays C/C++ languages there is no in,out so you have to use assembly again. With such you could set up desired video or text mode and from there just use direct access to framebuffer on VGA (as simple as writing to array + some page flipping for bigger resolutions)

On modern OS is this no longer possible as all HW and Memory access must comply priviledges ... So in order to access gfx card you have to connect to gfx driver or write its own however that requires ring0 priviledges so you either need to create and install device driver (not easy and from win10 also not cheap and you need Driver SDK for that which is also sort of lib) or use universal driver like JUNGO or use OS and gfx vendor provided gfx api like OpenGL,DirectX,GDI however all of these are considered lib,api ...

The only workaround is use what you have at disposal which is text console output (text mode window or console) along with ASCII art.

see Display an array of color in C

If you are on MCU or whatever platform where you have unrestricted access then writing own driver is OK for example see:

  • 2D,3D rendering engine for SSD1306 LCD

However writing driver for gfx on PC is not good idea as you would need to support all the gfx cards used and that is too much work (and you would have hard time to obtain relevant info needed to do it anyway) so in reality using existing gfx api along with existing drivers is the only way which means you HAVE to use libs/apis if you want "real" graphic...

2 of 3
0

I dont know about writing them without any libraries, because you will ultimately have to use some library to interface with the GPU for graphics. The most common graphics APIs for C and C++ are OpenGL and Vulkan, both being great hardware accelerated APIs developed by Khronos, with the latter being lower level than the former. There's also SDL which isn't hardware accelerated, but it is easier to use.

🌐
Chalmers University
cse.chalmers.se › edu › course.2018 › TDA362 › LearningModern3DGraphicsProgramming.pdf pdf
Learning Modern 3D Graphics Programming Jason L. McKesson
Any substantial discussion of 3D rendering requires a discussion of mathematics, which are at the foundation of all 3D graphics. This book ... The tutorials will present the more advanced math needed for graphics as it becomes necessary, but you should have at least a working knowledge · of geometry and algebra. Linear algebra is not required, though it would be helpful. The code tutorials in this book use OpenGL as their rendering API. You do not need to know OpenGL, but to execute the code, you must have a · programming environment that allows OpenGL.