Questions tagged [c]
C is a general-purpose computer programming language used for operating systems, libraries, games and other high performance work.
284 questions
0
votes
1
answer
79
views
Voxel Level Storage
I want to know some methods of storing the voxel data in a game like Infiniminer or Minecraft in a C++ program. What file types can do this easily? The voxel values will be big possibly a trillion by ...
0
votes
1
answer
100
views
What is the preferred memory to store game object into, Stack memory or Heap memory
In the context of game dev, what is the preferred memory to use to store structs like Entities or MapData which are large in size and have lifetimes lasting the entire game run-time.
For example here ...
0
votes
2
answers
133
views
Linked list in C
I only know C, no other language.
How do I use a linked list to store projectiles in sdl2?
My bullet currently has an sdl_image, has been queried and has the following properties:
...
0
votes
0
answers
42
views
Collision detection for a newbie [duplicate]
I am a freshman cs major with an interest in game dev. I know next to nothing and am very new to this so please bare with me.
TLDR; Should I use BSP for detection between moving and static objects as ...
0
votes
0
answers
61
views
How do I make my Software 3D Renderer slow down as soon as I change the screen resolution during runtime?
I'm writing a Software 3D Renderer in C many months after I first originally wrote it in Python. It is made using SDL2. My engine currently has depth shading, perspective correct texturing and some ...
0
votes
1
answer
105
views
OpenGL doesn't render even though all Objects and Data seems to be correctly set up
No shape seems to show up on screen even though I have meticulously verified everything.
The data set I use which is parsed by my code CORRECTLY(I checked that) to be loaded into a generic array ...
0
votes
0
answers
58
views
Invalid Pixel Offset Calculation Fix?
I am currently using a SDL_Texture *texture as a chunk in my world that is being Perlin noised onto to make terrain.
Using a 2d array of these I tile the plane. But ...
0
votes
0
answers
65
views
Is there more efficient method of terrain rendering in 2D plane than redrawing millions of SDL_FRect each frame
I want to render terrain efficently using perlin nosie and a lots of rects. Should I use rects or is there another way. Following is my implementation.
I use rect size = 1 which is not really ...
0
votes
1
answer
121
views
what is "viewport" mentioned in the raytracing in one weekend book?
I'm trying to make a simple raytracer following the raytracing in one weekend book, but I couldn't understand why is he using what is called a viewport, he define it as a virtual rectangle, why don't ...
0
votes
1
answer
84
views
Variable subdivision creating artifacts
I'm currently implementing a method for subdividing an icosahedron found here that isn't quite working as expected due to the artifacts created (and the way the triangles are oriented)
The problem ...
0
votes
0
answers
75
views
Need help to organize 2D AABB collision engine quad node structure
In short:
I'm writing my custom 2d collision engine in C and I've chosen to use quad nodes to optimize collision detection. My implementation defines 2 things: the quad node (Quad_s) and the elements (...
0
votes
1
answer
150
views
Why do I need two/three Vulkan pipelines for GUI presentation
For any that want to plumb Vulkan's complication I wish you well.
It's a badly documented software SDK and here's a perfect example of why it's never clear through context: I want to run an all-C ...
0
votes
0
answers
136
views
Why is my Gouraud Shading not working correctly?
I am trying to write a 3d Renderer in C using SDL and cgml but my shading seems to be not working correctly. When rendering the teapot I get seams and when I want to render a cube I get a bright white ...
0
votes
1
answer
94
views
Glyphs are not being drawn [opengl + freetype]
I've followed this source from learnopengl.com for text rendering. It seems fairly simple, and only required this much code:
...
0
votes
0
answers
64
views
How to re-design the graphics logic behind my game to preform better?
Recently, I have been working on a small "pet-project" of mine in C using the SDL library. I have noticed that without my render-calls, my project takes up 2% of the CPU and with the render-...