The C programming language.

learn more… | top users | synonyms

-1
votes
0answers
34 views

A program in OpenGl [closed]

I wrote a program in C++ OpenGl which to insert a special character to the display window display for entering characters ... for example by enter 'A' character the open windows shows A . but i don't ...
0
votes
0answers
47 views

Need help writing my snake game [closed]

I want to make a classic snake game. I have a decent amount of experience in C programming, but I am relatively new to game programming. For the snake game I use an array of the playing field to ...
-2
votes
0answers
18 views

Incorporating Rastek light issue [closed]

Hello i have a few issues with Directx, i am trying to make diffuse light work whithin my code. But the book i have doesn't really work for me and i'm now trying incorporate the light from Rastertek ...
0
votes
2answers
48 views

Overload how an object instance of a class is treated when used

So I've made this struct that encapsulates a glm::vec4. This is because vec3s are treated as 16-byte in GLSL, but I don't want to assign a vec4 if I only really need 3 components. Anyway, my question ...
1
vote
1answer
151 views

C++ Ray Traversing in 3D Voxel game

I'm currently working on a Voxel game in 3D and need a tad bit of help to figure out what Voxel the player is looking at. This is the data I currently have: GRRLIB_Camera3dSettings(Player.x, ...
1
vote
2answers
49 views

c - Starting an user defined function after the current one ends

The game I am creating displays a menu before starting, the user may select to start the game, or do some stuff. When the user selects an option, I need to call another function which actually does ...
1
vote
1answer
32 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
252 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
278 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
59 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
339 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
118 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
61 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
83 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
51 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
132 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
601 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
130 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
216 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
389 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
197 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
39 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
100 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
140 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
117 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
97 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
213 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
156 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
165 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
57 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
149 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
122 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
436 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
401 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
582 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
143 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
107 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
558 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
801 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
224 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
211 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
611 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
298 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
599 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
237 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
154 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
209 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 ...