Questions tagged [c]

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

284 questions
54
votes
12 answers

Is it reasonable to write a game engine in C?

Even though C++ appears to be king, from what I've been told C is still widely used in games, especially on the consoles. However, would writing an entire game engine in C be unreasonable today? What are, if any, some advantages that C has over C++?…
bruxisma
  • 758
  • 1
  • 6
  • 8
39
votes
5 answers

Any tips for creating cross-platform games?

Do you have any tips/recommendations when creating a cross-platform game in C/C++?
Dr. Snoopy
  • 5,115
  • 10
  • 36
  • 36
35
votes
2 answers

A good way to build a game loop in OpenGL

I'm currently beginning to learn OpenGL at school, and I've started making a simple game the other day (on my own, not for school). I'm using freeglut, and am building it in C, so for my game loop I had really just been using a function I made…
Jeff
  • 2,478
  • 4
  • 24
  • 29
25
votes
7 answers

Consistent cross platform procedural generation

What techniques have people successfully used or can suggest to deal with a consistent cross platform math for procedural world generation? Also, if you have done this, what were the pros and cons of your approach? In particular, I'm trying to…
Roy Ward
  • 783
  • 5
  • 15
22
votes
4 answers

How much assembly is really used in modern game code?

On average, how often is assembly used in modern game code? Specifically on platforms that already have good C++ compilers, like x86, PPC, or ARM--because I assume games on embedded systems make extensive use of assembly.
Legion
  • 333
  • 1
  • 2
  • 5
19
votes
10 answers

Game Development In C Only. Is it possible?

I am a first year college student in India and want to make a small game as a this semester project. I am quite good at C and am learning it rapidly but I wanted to ask if developing a game entirely in C (no C++ or C#) I'd love to use these but for…
Ishan Sharma
  • 309
  • 1
  • 2
  • 5
19
votes
4 answers

Why has the industry switched from C to C++?

First of all i would like to have a real answer, i'm always trying to get more from various sources and articles, and when I read things like C++ is slow because it has virtual functions and because of this C is better , i really don't know what to…
user827992
  • 1,981
  • 2
  • 20
  • 29
15
votes
1 answer

How can I tell how much video card memory I'm using?

I want to programmatically determine at runtime how much video card memory is being used by my program. Specifically I'm wondering about how to do it on a Windows machine using OpenGL, but am interested of ways to do it on other platforms as well. I…
Hitesh
  • 253
  • 1
  • 2
  • 6
14
votes
3 answers

Writing Game Engine from scratch with OpenGL

I want to start writing my game engine from scratch for learning purpose, what is the prerequisites and how to do that, what programming languages and things you recommend me? Also if you have good articles and books on that it will be great. Thanks…
Wazery
  • 411
  • 1
  • 6
  • 9
11
votes
3 answers

Is GNU GCC used for AAA games?

GNU GCC is a very common compiler, but it seems like almost no one uses it for bigger projects like AAA games. To me, it's works just fine, never had a problem with it. But I wonder why all AAA games seem to use commercial compilers such as Intel…
LiquidFeline
  • 1,391
  • 2
  • 13
  • 34
11
votes
1 answer

Floating Point Precision (fp:precise vs. fp:fast)

In C or C++, does the compiler option of floating point precision really make a difference in real world (small/indie) games? From my observations, setting fp:fast is many times faster than fp:precise and from what I understand here (…
Inisheer
  • 502
  • 1
  • 7
  • 17
11
votes
2 answers

How can I generate a texture that looks like left-over tea leaves?

We are working on a project for iPhone and Windows Phone 7 where we'd like to be able to generate tea leaves at the bottom of a cup. It doesn't have to look photo-realistic, and actually cartoon-y is ok. What sort of techniques should we research to…
Jedidja
  • 273
  • 1
  • 3
  • 7
11
votes
2 answers

What are the best ways to serialize and unserialize network messages for C/C++ multiplayer game?

We are using JSON right now and want to move to a binary format for some types of messages between client and server. Should I just read structs into the socket? Use proticol buffers/thrift? How should I represent arrays of data? What should the…
HaltingState
  • 806
  • 1
  • 6
  • 13
10
votes
4 answers

Is there a sound library for C to generate sound samples from code?

I'm working on an engine for a retro-style game in C. I'm looking for a sound library that would produce chip sounds from code...I want to make my own simple chiptune tracker for the engine to create music. Does such a thing exist? I'd also be…
rzrscm
  • 160
  • 1
  • 1
  • 9
10
votes
2 answers

Should the color of a texture be adjusted for display on a television?

If a 24bit RGB image with a range of 0-255 per channel is displayed on a television that displays a range of approx. 16-235 per channel, color detail will be lost, correct? If so, should images be pre-processed to only store a valid range? I would…
x-x
  • 910
  • 6
  • 12
1
2 3
…
18 19