The C programming language.

learn more… | top users | synonyms

0
votes
1answer
57 views

Mutlplayer game organization [closed]

I'm planning to create an RPG that you can play in multiplayer. The graphics will be simple ASCII. I will do the client C and the server in Python. Having never done a multiplayer game was wondering ...
1
vote
1answer
29 views

How can I send matrix data to shaders without the Effects11 framework?

I'm making a Direct3D engine but I'm stuck with this one little problem. I want to not use effect files but instead use shader files. What can I use to send matrix variables to shaders if I don't use ...
0
votes
0answers
13 views

Lua mud using c snippet for protocols? [duplicate]

I've been working on teaching myself to program in Lua for the past couple of months and I've been working on my own MUD using lama as my starting point. I've learned a lot and added quite a bit of ...
1
vote
2answers
194 views

How to detect graphics API at runtime with SDL2?

Using SDL2, is there a way to determine at runtime whether the application is using OpenGL, OpenGLES, or DirectX? EDIT: If there is a way to figure it out without using the SDL2 API, I'm willing to ...
2
votes
1answer
190 views

Emscripten code and three.js

I would like, if it's possible, to use Emscripten code generated from C/C++ with the Javascript library three.js. For example, from emscripten code I want to pass rendering information to the three.js ...
0
votes
1answer
54 views

Can I directly pass a Boost ptr_vector list to glBufferData?

I have a data structure like this: typedef struct vertex_ { float x; float y; float z; float s; float t; }vertex; Then I add to a list called: boost::ptr_vector<vector> vertices; Is there a ...
0
votes
1answer
162 views

Scaling an SDL Surface

I want to create a button for a game's UI. The background uses a gradient and then I blit a surface on top of the gradient and use SDL_SetColorKey to delete the unwanted pixels. The surfaces are not ...
0
votes
2answers
113 views

which quarter of a triangle the point is in

I've got a world made out of squares. The square are devided in four triangles like this: The corners have their heights stored in a 2D array and the center height is the average of the corners. To ...
0
votes
1answer
49 views

SDL Surface clipping mask

I am creating a GUI for my game, so I use some buttons like . So you can see it is only text surrounded by a rectangle. But I currently use a huge png image with all the buttons I need arranged as I ...
0
votes
0answers
73 views

Sometimes my game runs fine, other times it's shaky, why?

I'm trying to learn how to make games. I just did this very simple 3D game where you control a cube that shoots at incoming cubes. Sometimes I start the game and it runs smoothly from start to end. ...
0
votes
1answer
44 views

Accelerated Motion

I'm making a menu for my game with SDL, when you click on an option a sub menu slides down and is shown, just sliding down is really boring, so I want it to accelerate(like if gravity was pulling it) ...
5
votes
3answers
1k views

Is it a good plan to use 2D physics for a 3D racing game? [closed]

I am working on a 3D racing game using SDL and OpenGL. I thought it would be easier to use a 2D physics engine, since I really don't need the 3rd dimension. There will be no flying cars or jumps, they ...
3
votes
1answer
126 views

How to get scripted programs governing game entities run in parallel with a game loop?

I recently discovered Crobot which is (briefly) a game where each player codes a virtual robot in a pseudo-C language. Each robot is then put in an arena where it fights against other robots. A ...
-2
votes
2answers
372 views

Which library to choose between SDL and GTK for C game Development (Begginer) [closed]

Note: I know that this is a opinion based question I've been programming in C it's been some time, now I want to get into game development but I'm not sure which GUI library should I use between SDL ...
3
votes
1answer
119 views

Collision detection in Pong clone

Well I'm trying to create a pong clone using SDL and I had some problems with the frames and some times the ball would go through the paddles despite the fact that at other times the collision worked ...
0
votes
2answers
196 views

Is networking programming quite generic

I have only looked into the basics, at least I assume it gets more complex. So does network code really change from one game to the next or is it pretty much portable. For example I can create say a 2 ...
0
votes
1answer
290 views

Render two images to an SDL_window

I want to create a menu for an SDL game, so I load an Image to an SDL_Window as the background, then I try to load the next image which will be a button but it doesn't display the button to the ...
1
vote
1answer
134 views

Background color gradient with SDL

I want to create a menu for a game using a color gradient as the background. Is there a way to create a gradient background instead of using an image for it (since I don't know what size the window ...
0
votes
1answer
38 views

Problem with .hdr/.pic format

So, everything was clear from the specification point of view, but when I moved to reading through some of the original implementations and reimplementations, I ran into this: f = ...
-6
votes
2answers
94 views

Is padding brackets objectively the best way to write C programs? [closed]

void Function( int, char ) versus: void Function (int,char) My friend keeps saying otherwise. What is objectively the best way to write brackets?
1
vote
2answers
127 views

Using Lua for configuration and localization data

Since my game is already going to be scripted with Lua, I've decided to make all my configuration and localization data defined using Lua tables. For example, this could be a basic locale file: -- ...
1
vote
1answer
114 views

How to draw or translate into world space?

I've been hacking around with OpenGL, but there's a few concepts which I can not find the answer on. I want to draw three GL_QUADS next to eachoter like so: 1[2][3] I know GL_QUADS are deprecated, ...
4
votes
1answer
95 views

Dealing with interpolation and object creation/destruction

I've implemented a game loop similar to that in Glenn Fiedler's Fix Your Timestep! article. I have an update step running at 50Hz and a render step running at 60Hz (monitor refresh rate). To keep ...
1
vote
1answer
184 views

How to adjust a font to fit inside a speech bubble?

I'm creating a game that contains a speech bubble for dialog. The idea of this function is to allow one call to set new text in a speech bubble. The speech bubble will adjust in size of the new font ...
1
vote
1answer
136 views

Update and Render logic with interpolation

I am working with C and SDL2 and just wanted some insight as to how to properly apply interpolation to the rendering. EDIT - some clarification, update() input() and render() are just hypothetical ...
0
votes
0answers
161 views

bones programmatically in assimp

I am trying to animate a 3d hand object programmatically in Assimp, I have the 3d model being export to collada using Blender. But I have no idea how to go from one bone animate it and then go to the ...
1
vote
0answers
52 views

Sampler object not changing texture filter

I am currently binding a sampler object to a texture (GL_TEXTURE12 to be specific) with glBindSampler(12, sampler); and the initial settings are very visible compared to the textures own settings. ...
0
votes
1answer
134 views

Linking error at tessellation shaders in GLSL

I'm testing the triangle tessellation from the link http://prideout.net/blog/?p=48#shaders . All the shader are compiled correctly, but when I try to link the program using the command: ...
1
vote
1answer
110 views

When creating the horizontal blur, how is the vertex shader being called for each pixel?

I am following this tutorial. I am confused as to why the VertexShader is being called each time for the PixelShader. I was under the assumption the VertexShader is called only 6 times during the ...
0
votes
1answer
340 views

Set Sampler states: Linear, Bilinear, Trilinear Filtering/Interpolation

How do you set each of these sampler states in the hlsl Linear filtering Bilinear filtering Trilinear filtering
3
votes
2answers
333 views

Using quaternions, how do I determine if an object is upside down from an original rotation?

Imagine this scenario: An object is laying flat on a horizontal surface, from this an original rotation is determined. Then the object is moved, and at some point flipped upside down and put back down ...
2
votes
2answers
459 views

Is it possible to use DirectX in pure C program?

I want to try something simple with Direct Sound. Just want to know if it's possible. Or maybe I need some other API?
3
votes
3answers
141 views

Should I use select() for networking in my gameloop?

I'm writing a simple networked game in C/C++. To keep things simple I'm using TCP. In my server's game loop I'm using a POSIX select() with a zero second timeout for two things: Discover incoming ...
0
votes
1answer
100 views

Luminance increase in SDL

We have managed to create grayscale picture using the following snippet of codes in SDL. What we need to do now is how to first convert into YUV or YCrCb for it be able to set the luminance value and ...
0
votes
1answer
492 views

SDL gray scale image from a a color image?

I am new to sdl. I have basically have the following codes which can load the images. I know how to access the pixel as below. What I need it to convert the image to 8 bit grey level and 1 bit ...
0
votes
1answer
653 views

Can you use python, c and c++ in udk without plugins?

Im pretty new to game engines and i was wondering if I could use python, c and c++ in udk. I've tried getting the answer all over the internet but the answers i do find aren't very clear. So am i ...
0
votes
1answer
211 views

Creating a fragment shader to darken a white texture over time - OpenGL GLSL

So as a part of learning OpenGL, I've now decided to try and be a bit more creative with shaders, as part of a practice game I'm making using C/OpenGL. I'm completely new when it comes to working ...
1
vote
0answers
193 views

GLX/X11 Changing the rendering resolution

I have made a simple application that creates a window with an OpenGL 4.2 context and takes user input. I have implemented making the window go fullscreen with XRandR and can change the display ...
1
vote
1answer
546 views

Understanding the z-axis vector from OpenGL modelview matrix

I would like to shoot spheres in the current view direction in a simple scene. I use an FPS camera, so no z-rotation. The vector pointing in the correct direction should be (m[8], m[9], m[10]) where m ...
0
votes
1answer
277 views

Node.js/V8 as a Platform for High End Local PC Game Development?

As a Web/UI dev rapidly expanding into more wide-open generalist territory, the more I learn about how its done in other languages, the more I love JS for architectural and basic ...
1
vote
1answer
534 views

does glBindAttribLocation silently ignore names not found in a shader?

Does glBindAttribLocation silently ignore names that are not found? For example, in a shader: // Some vertex shader in vec3 position; in vec3 normal; // ... And in some set up code: // While ...
1
vote
1answer
220 views

Score system for “little bit more complex” snake game

I have created snake game. I can't think of good score system so that is is fair. There is only one highscore list for all modes. Player can choose any size of board - Let's call that param "Board ...
0
votes
1answer
130 views

How can I capture key events on the Mac when using OpenGL?

I have code that renders a triangle using OpenGL. I would like to control it using the arrow keys on the keyboard. Anyone know how I would do this on OS X? I think I can create an Objective-C file ...
0
votes
1answer
192 views

Would it be inefficient to call LWJGL from C++?

I like LWJGL, but Java? Not so much. I recently found out a way to call Java methods from C++. But would this be inefficient? I mean, calling a C/C++ DLL from Java, just to be called back again into ...
10
votes
3answers
2k views

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

SDL text or additional images not loading

I've got a basic side scroller that allows the user to run and jump around. I've used various tutorials to get this far, but I can't seem to get any text to render, no matter what method. I also can't ...
1
vote
2answers
571 views

Exclusive mouse movement with WM_INPUT

Microsoft seems to recommend using WM_INPUT for input. I want to only get relative mouse input and hide the mouse cursor all together for a short while (For gesture based input). However, using ...
1
vote
1answer
96 views

Physics Simulation - Pushing an object with user control

I'm working on a 2D game engine using C, SDL and OpenGL. Have worked out basic graphics, physics, and broad phase collision detection. I am trying to realistically simulate "pushing" objects around. I ...
0
votes
2answers
238 views

joystick movement for Geometry Wars clone

I am kinda new in game programming, but I've got a semestral work to make a game, so I decided to do a clone of Geometry Wars. Despite that the game is really simple (in principle), I have ran into a ...
2
votes
2answers
300 views

How can I switch between scenarios in a text game?

I am making a text-based adventure game. How should I go about changing to another scene if the player wants to e.g. go to the house or walk down the road? I am using Objective C, but C will work ...