The C programming language.

learn more… | top users | synonyms

2
votes
1answer
164 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
138 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
309 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
459 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
275 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
189 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
837 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
248 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
3k 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
4k 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 ...
15
votes
3answers
3k 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
428 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
468 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
214 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 ...
2
votes
1answer
364 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
550 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
447 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
575 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
426 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
182 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
791 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
958 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
662 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 ...
7
votes
1answer
740 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
561 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
174 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
572 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
693 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
431 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
609 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
537 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
582 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
414 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
344 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
454 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.
-6
votes
2answers
779 views

Is it possible to use OpenGL purely with C instead of C++?

Is it possible to use OpenGL purely with C instead of C++? I am wanting to make sure there won't be any problems with my using C and not C++. OpenGL does not depend on any C++ libraries right?
4
votes
3answers
763 views

scanline filling a trapezoid

I have computed the four corners of the viewable bit of 2d map in my 3d view. So I know the trapezoid that is visible, and I want to 'visit' these tiles in my map. So my algorithm is basically a ...
2
votes
3answers
4k views

What popular/famous games are written in C? [closed]

It is very similar to this question: Famous games written in Java Does anyone know of any popular or famous games only written in C?
0
votes
2answers
447 views

CubeRealm OpenGL rotation problems, need help. :\

I'm totally new to OpenGL and I'm working on a Sandbox game called CubeRealm. My problem you see is rotation. I've got it in my head that to rotate the 'camera' I just rotate all the scene by the ...
1
vote
3answers
2k views

Walkin on terrain - Opengl

i wanna walk to terrain... first i created the terrain void desenha_terreno(float px, float pz){ for (int z = 0; z < iwidth-1; z++) { glBegin(GL_TRIANGLE_STRIP); for (int x = 0; x < ...
1
vote
3answers
454 views

How to find the bottleneck of the graphical pipeline

I've been wondering about this issue for a while. How to find the bottleneck of the graphical pipeline. Recently I've been using a program to draw massive amount of polygons in a simple scene with ...
3
votes
2answers
2k views

How do games make fire and smoke effects?

I was wondering around, searching internet about particle system and fire effects but I haven't found any good answers. On some games I have realized that some sort of movie is being shown as the ...
1
vote
1answer
350 views

GML and C/C++ language question

Is GML (Game Maker Language) script is clipped in C/C++ language, and GML wrote the code to Visual Studio C++, it will always be correct, because it is just under C++ language features? I think that ...
9
votes
3answers
17k views

Writing Game Engine from scratch with OpenGL [closed]

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 ...
10
votes
2answers
462 views

Can I call c functions within the XNA framework?

I would like to make a 360 game and was just wondering if I could re-use some existing C code I have or whether I need to re-write everything in C#. Any help is appreciated.
3
votes
1answer
348 views

Is there are a good double-precision small matrix SIMD library for x86?

I'm looking for a SIMD library focused small (4x4) matrix operations for graphics. There's lots of single precision ones out there, but I need to support both single and double precision. I've looked ...
3
votes
1answer
113 views

connecting multiple anti-aliased lines together

I implemented/copied the wu line algorithm from pseudo-code on wiki-pedia and other places. When drawing a sine wave it breaks down at the point where the line changes from y dominant to x dominant ...