Skip to main content

Questions tagged [c]

C is a general-purpose computer programming language used for operating systems, libraries, games and other high performance work.

Filter by
Sorted by
Tagged with
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 ...
Opengraphicspros12's user avatar
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 ...
Syntax Error12's user avatar
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: ...
L1ghtkage CaptainL1ghtning's user avatar
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 ...
L1ghtkage CaptainL1ghtning's user avatar
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 ...
DehGoose's user avatar
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 ...
Syntax Error12's user avatar
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 ...
Syntax Error12's user avatar
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 ...
Syntax Error12's user avatar
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 ...
Anas Jawad's user avatar
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 ...
Chillzy's user avatar
  • 47
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 (...
magg's user avatar
  • 11
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 ...
daemondave's user avatar
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 ...
Finn's user avatar
  • 1
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: ...
Scollier's user avatar
  • 124
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-...
Renadil's user avatar

15 30 50 per page
1
2 3 4 5
19