The C programming language.

learn more… | top users | synonyms

3
votes
2answers
305 views

How does this background scrolling code work?

I'm glad that this code does exactly what I wanted it to do...But I can't make sense of it although I wrote it from scratch myself. What I wanted to do was create an infinitely scrolling background. ...
5
votes
4answers
1k views

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

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 ...
0
votes
1answer
183 views

char* to code block

I am 99% certain this will require code compiling at runtime, but it is necessary. I am thinking of making a very simple app that allows advanced users to write in a script-like language in order to ...
1
vote
1answer
361 views

How do I store multiple bullets' coordinates?

My game is a 2D game(or tries to be) in pure C using SDL(no OpenGL at all). No specific goal in it, it's pretty much boilerplate code. I decided I want to make my character/player shoot "something", ...
-5
votes
3answers
865 views

What compilers are used in game development? [closed]

I was kinda wondering what compilers are used in game development, since the game development industry always tries to squeeze every inch of performance out their software, using, among other, ...
1
vote
1answer
729 views

Image loaded from TGA texture isn't displayed correctly

I have a TGA texture containing this image: The texture is 256x256. So I'm trying to load it and map it to a cube: #import <OpenGL/OpenGL.h> #import <GLUT/GLUT.h> #import ...
-1
votes
2answers
254 views

My 2D collision code does not work as expected. How do I fix it?

I have a simple 2D game with a tile-based map. I am new to game development, I followed the LazyFoo tutorials on SDL. The tiles are in a bmp file, but each tile inside it corresponds to an internal ...
1
vote
2answers
249 views

How do I cap rendering of tiles in a 2D game with SDL?

I have some boilerplate code working, I basically have a tile based map composed of just 3 colors, and some walls and render with SDL. The tiles are in a bmp file, but each tile inside it corresponds ...
2
votes
2answers
583 views

Clutter for game GUI

I'm pretty new to game development, having only written a simple 3d game for a class project, but I'd like to get started on a bigger project. I'm writing an MMORPG to run in both the browser (WebGL) ...
0
votes
2answers
1k views

Is there an alternative to SDL 1.3 for a C++ game that should run on iOS and Android?

I've used SDL for many desktop games, always as the cross-platform glue for: Creating a window Processing input Rendering images Rendering fonts Playing sounds/music It has never disappointed me ...
3
votes
1answer
715 views

Procedurally generated 2d terrain for side scroller on Sega Genesis hardware?

I'm working on the Sega Genesis that has a 8mhz Motorola 68000 CPU. Any ideas on how to generate fast and decent 2d tile terrain for a side scroller in real time? The game would generate new columns ...
2
votes
5answers
571 views

Is It More Efficient To Make Games In Languages I Like?

Is it more "efficient" to develop games with languages you're good with and like best rather then the "best" language? For example: I like C# (It's My First Language) and I'm really good at it and ...
2
votes
1answer
167 views

How to alter image pixels of a wild life bird?

Hello so I was hoping someone knew how to move or change color and position actual image pixels and could explain and show the code to do so. I know how to write pixels on a surface or screen-surface ...
1
vote
1answer
142 views

State machine interpreters

I wrote my own state machine tool in C and at this point I'm faced with two choices for specifying state machines. Crafting a little language and writing a interpreter. Writing a compiler for that ...
0
votes
1answer
338 views

Data-driven animations

Say you are using C/SDL for a 2D game project. It's often the case that people use a structure to represent a frame in an animation. The struct consists of an image and how much time the frame is ...
3
votes
3answers
517 views

Semi Fixed-timestep ported to javascript

In Gaffer's "Fix Your Timestep!" article, the author explains how to free your physics' loop from the paint one. Here is the final code, written in C: double t = 0.0; const double dt = 0.01; double ...
-3
votes
1answer
280 views

Why it is C++? [duplicate]

Possible Duplicate: Why has the industry switched from C to C++? Since many organizations have demonstarated Object orientation in C and we all know its ABI compatibility that C++ lacks, ...
1
vote
2answers
201 views

Making an interface for input in C - How?

I have a big question. I started to develop a simple 3D engine (or should I call it framework?). I use OpenGL for rendering and it is developed for Windows. It is all written in C. But I don't know, ...
5
votes
1answer
936 views

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 ...
6
votes
4answers
4k views

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 ...
4
votes
2answers
255 views

Advice creating build process for medium sized game project

I've been looking through the SCons build script for Doom3 and researching different approaches to build processes used by professional game developers/studios (C/C++) and I've come across a few ...
3
votes
3answers
4k views

Simple 2D Collision Detection Algorithm Library

I'm building a simple OpenGL game and I was looking for some simple collision detection library for objects like squares, triangles and circles. Any suggestions? PS: Preferably a library that is very ...
3
votes
2answers
5k views

Creating an OpenGL FPS camera: I have the position and orientation vectors, now what?

I have been struggling to create a first person camera in OpenGL ES 2.0 without using gluLookAt(). I grab the camera's orientation vectors (the way it's looking) from the current modelview matrix, and ...
17
votes
3answers
4k views

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 ...
0
votes
1answer
451 views

OpenGL 2.1+ Render with data returned form assimp library

I have just readed this tutorial about load a 3D model file: http://www.lighthouse3d.com/cg-topics/code-samples/importing-3d-models-with-assimp/. Its render routine uses a recursive_render function to ...
-1
votes
1answer
503 views

How to fix OpenGL Co-ordinate System in SFML?

My OpenGL setup is somehow configured to work like so: (-1, 1) (0, 1) (1, 1) (-1, 0) (0, 0) (1, 0) (-1, -1) (0, -1) (1, -1) How do I configure it so that it works like so: (0, 0) (SW/2, 0) (SW, 0) ...
6
votes
2answers
217 views

What does the Sys_PageIn() function do in Quake?

I've noticed in the initialization process of the original Quake the following function is called. volatile int sys_checksum; // **lots of code** void Sys_PageIn(void *ptr, int size) { byte ...
3
votes
1answer
407 views

Fog with Blend in OpenGL

I want to add fog in my scene which contain transparent textures made by Blend , when i enable the fog the transparent textures appear white From a distance but when i disable it the textures ...
3
votes
3answers
596 views

What algorithm can I use to detect simple shapes in a 4x4 matrix?

I'm working on a simple multiplayer game that receives a random 4x4 matrix from a server and extracts a shape from it. For example: XXOO OXOO XXOX XXOO XOOX and XOOO XXXX OXXX ...
11
votes
2answers
451 views

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 ...
2
votes
1answer
1k views

Recent mainstream games written in pure C? not C++ what was/is the point? [closed]

Recent meaning the current decade. I had found this post http://gamedev.stackexchange.com/a/15403/6544 wasnt c++ adopted as the industry standard quite some time back. In what sort of situation does ...
4
votes
3answers
590 views

How do I do a game loop in c99?

I'm having trouble with how to structure a game using c99. I've seen a few tutorials on making a game loop, but they are all done with c++ and classes. My main problem seems to be moving data around ...
-3
votes
2answers
435 views

Game programming in C, where do I get started? [closed]

I started programming about 6 months back and have a decent knowledge in how to code in C. I have mainly used it to implement elementary algorithms or solve Project Euler questions (reached 50 now :) ...
3
votes
1answer
189 views

Techniques for benchmarking code running on the Sega Genesis' 68000 CPU?

I'm playing around with writing code for the Sega Genesis, which uses a Motorola 68000. I'm not an assembly code guru by any means so I'm writing in C and using SGDK. As it's slower than assembly, I'd ...
1
vote
1answer
843 views

Translating local to global coordinates in ARToolkit / OpenGL

Ok, so I've tried reading over the other questions and something's just not clicking for me. I am working on an augmented reality application using ARToolkit, however it should just be straight ...
2
votes
1answer
1k views

How should I manage multiple entities?

Before I start making a game, I'm trying to figure out how I will manage things. One of the first things I'm not sure about is how to manage entities (enemy, player, projectile...) I'm going to be ...
0
votes
1answer
763 views

glBlendFunc transparency in cocos2d?

GL_ONE, GL_ONE This makes the flamingoes transparent on: http://www.andersriggelsen.dk/glblendfunc.php but not in cocos2d using: sprite.blendFunc = (ccBlendFunc){GL_ONE, GL_ONE} How can I achieve ...
8
votes
1answer
765 views

Processing component pools problem - Entity Subsystem

Architecture description I'm creating (designing) an entity system and I ran into many problems. I'm trying to keep it Data-Oriented and efficient as much as possible. My components are POD ...
1
vote
3answers
583 views

How to save game progress (savefile)

I am currently working on a terminal text game just to practice my skills (C). It will be story driven escape the mansion kind of game. Even though the game will be short I want it to support save ...
0
votes
3answers
178 views

How should I proceed next with my programming skills? [closed]

I am currently studying at University of technology in Brno (Czech Republic). This semester is almost over and I might say I have some knowledge of C. Since I went to this school just for the purpose ...
1
vote
0answers
592 views

Getting started with game dev- allegro and C/C++ [closed]

Was considering getting started with Allegro for learning game development, and I was wondering (yes, sorry) whether I should go with C or C++ :P. I know C++ is way more common in the game dev world ...
5
votes
1answer
737 views

Advice for programming a lobby for a network multiplayer game?

I'm working on learning network programming. I'm working on a simple card game. The basic idea is: Players enter the lobby Players see tables Players sit at an empty seat Once they sit, they do not ...
2
votes
2answers
465 views

Deterministic replay in a modern game

I am doing a study in modern games graphics, and as part of the study it would be really helpful to be able to replay a sequence in the game multiple times. For example, recording a series of inputs ...
0
votes
2answers
662 views

Ogre3D: customize water demo

On the water demo supplied with Ogre3D's SDK, controls are set to actually control the camera and environment, but not actually the ogre head that generates the disturbances. I tried digging into the ...
7
votes
6answers
551 views

Is it possible to write a game that doesn't require a GPU?

I already know many computers today have a GPU that supports DirectX and OpenGL. But what about computers that don't? Can I write a simple 2D game that does not rely on the GPU, so that it works even ...
1
vote
2answers
603 views

Trying to implement Render to Texture

I'm having trouble implementing render to texture with OpenGL 3. My issue is that after rendering to the frame buffer, it appears the rendered object becomes deformed, which may imply a bad ...
4
votes
4answers
432 views

Video game entity storage and structures

I finally have all the working input/output of a game engine. However, I'd like to be able to put an amount of about 2000 shots being simulated in a region, total. I have done other games where all ...
9
votes
2answers
3k views

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 ...
1
vote
2answers
349 views

Are C and Objective-C sufficient for creating games on the iOS?

These days, I'm focusing on games development on the iOS. C++ is the lingua franca for games development but seriously, I prefer to code in C programming language, not in C++. So for iOS games ...
-6
votes
2answers
476 views

I want to use Python as a scripting language for my game, can I use it purely with C (not C++)?

I want to use Python as a scripting language for my game, can I use it purely with C (not C++)? It is important to me that I not use C++, and purely use C instead.