C++ is a statically typed, free-form, multi-paradigm, compiled, general-purpose programming language.

learn more… | top users | synonyms

2
votes
0answers
57 views

How to create a scripted sequence [closed]

Like countless other video games, I'd like to have scripted sequences in my game. Character 1 says something, the player replies, then a rock falls, that sorta stuff. I could find a way to do it, but ...
2
votes
0answers
30 views

FBX Importer - Vertex Color

I imported vertex positions, indices and normals successfully in OpenGL using fbx sdk, but I just can't figure out how to import vertex colors. I tried to fetch the pointer to array of colors trough ...
3
votes
1answer
149 views

Calculate the Intersection of Two Volumes

If you've ever played The Swapper, you'll have a good idea of what I'm asking about. I need to check for, and isolate, areas of a rectangle that may intersect with either a circle or another ...
2
votes
1answer
106 views

How can I compile a Direct3D 9 effect from a file?

I started working with shaders recently in DirectX9. I noticed that there is a D3DXCompileShaderFromFile function for IDirect3DVertexShader9 and pixel shader. Which compiles the shader and gives you ...
8
votes
3answers
2k views

Shifting from XNA/C# to C++? [closed]

For a while now, I've been working with XNA for game design and development (although only for personal use ATM.) Overall, I'm a major fan of XNA itself, and it's overall "feel." However, due to the ...
0
votes
0answers
68 views

Libnoise producing completely random noise

I am using libnoise in C++ taken and I have some problems with getting coherent noise. I mean, the noise produced now are completely random and it doesn't look like a noise. Here's a to the image ...
0
votes
0answers
60 views

OpenGL Drawing textured model (OBJ) black texture

I'm using OpenGL, Glew, GLFW and Glut to create a simple game. I've been following some tutorials and I have now a good model importer with textures (from ogldev.atspace.co.uk) but I'm having an ...
2
votes
2answers
214 views

C++ property system interface for game editors (reflection system)

I have designed an reusable game engine for an project, and their functionality is like this: Is a completely scripted game engine instead of the usual scripting languages as Lua or Python, this uses ...
1
vote
0answers
118 views

Weird y offset when using custom frag shader (Cocos2d-x)

I'm trying to mask a sprite so I wrote a simple fragment shader that renders only the pixels that are not hidden under another texture (the mask). The problem is that it seems my texture has its ...
3
votes
1answer
119 views

Open GL perspective projection vs orthographic projection

I am trying to build an engine using OpenGL however I have a question about the kind of projection to use. For a 2D game should I use a perspective projection or an orthographic projection? If I ...
0
votes
3answers
201 views

How do I prevent other dynamic bodies from affecting the player's velocity with Box2D?

I'm working on my player object for my game. PhysicsBodyDef def; def.fixedRotation = true; def.density = 1.0f; def.position = Vec2(200.0f, 200.0f); def.isDynamic = true; def.size = ...
2
votes
1answer
128 views

DirectX particle system. ConstantBuffer

I'm new in DirectX and I'm making a 2D game. I want to use a particle system to simulate a 3D starfield, so each star has to set its own constant buffer for the vertexshader es. to set it's world ...
1
vote
1answer
141 views

Quad Texture to Pixel Screen Space (DirectX 11)

I think I must be using the wrong wording for what I want, because I seached and just kept finding pixel shader questions. But this seems like something that anyone making a 2D game would want. ...
2
votes
1answer
168 views

How to swap row/column major order?

I'm trying to get a sprite sheet clipped in the right order but I'm a bit stumped, every iteration I've tried has tended to be in the wrong order. This is my current implementation. Frames = ...
0
votes
2answers
201 views

In a multiplayer game, should I store the list of character names on the Player class?

I am writing a multiplayer game that has account system and character creation system like standart MMORPGs. I have a question about name creating issue. I think that I can create a static variable on ...
13
votes
8answers
2k views

Which unit test framework for c++ based games? [closed]

Which combination of testing tools do you feel is best? Given the framework / library of your choice you might consider: suitability for TDD ease of use / productivity dealing with mock objects ...
0
votes
1answer
245 views

SDL2 window as child of Win32 GUI

I'm building an editor. Is it possible to create a child window of SDL2 within a Win32 gui? (The most obvious page from SDLTutorials works for earlier versions of SDL)
1
vote
1answer
174 views

Issue porting Cocos2d-x to Android

I've written a basic game using Cocos2D-x on XCode. It works fine on the iPhone. Now I'm trying to port it to Android. When I run the script ./build_native.sh inside the proj.android folder, it gives ...
0
votes
2answers
49 views

What is the correct way to reset and load new data into GL_ARRAY_BUFFER?

I am using an array buffer for colors data. If I want to load different colors for the current mesh in real time what is the correct way to do it. At the moment I am doing: glBindVertexArray(vao); ...
1
vote
0answers
39 views

Bullet Physics ConvexDecomposition?

I've looked at Bullet Physics ConvexComposition Demo and would like to implement that in my game but the code is so undescriptive and it's hard to understand what is going on. Would any of you people ...
0
votes
1answer
98 views

Bouncing ball slowing down over time

I use the unreal engine 4 to bounce a ball off of walls in a 2D space, but over time the ball gets slower and slower. Movement happens in the tick function of the ball FVector location = ...
1
vote
1answer
73 views

Correcting Lighting in Stencil Reflections

I'm just playing around with OpenGL seeing how different methods of making shadows and reflections work. I've been following this tutorial which describes using GLUT_STENCIL's and MASK's to create a ...
1
vote
1answer
156 views

Center directional light shadow to the cameras eye

I'm currently drawing my directional light shadow using this view and projection: XMFLOAT3 dir((float)pitch, (float)yaw, (float)roll); XMFLOAT3 center(0.0f, 0.0f, 0.0f); XMVECTOR lightDir = ...
0
votes
2answers
95 views

Can't read .cso files but I can read their .hlsl versions?

Well I've been trying to read a .cso file to use as a shader for a DirectX program I'm currently making. Problem is no matter how I implemented a way to read the file it never worked. And after ...
0
votes
1answer
58 views

Load Meshes with Bullet Physics

I just started implementing some physics in my game with Bullet Physics and I was just wondering how would i use bullet physics to load in meshes. For my for DirectX I load in x files into a ...
2
votes
2answers
233 views

Why is GL_TEXTURE_MAX_ANISOTROPY_EXT undefined?

So I'm writing my texture class in my opengl game, I get to the part where I would normally set GL_TEXTURE_MAX_ANISOTROPY_EXT, and I'm shocked to discover that it's undefined! This exact same ...
0
votes
0answers
37 views

How to raycast select a scaled OBB?

I have the OBB picking code to select an OBB with code inspired from Real time Rendering 3 and opengl-tutorial.org. I can successfully select objects that have been moved or rotated. However, I cant ...
2
votes
1answer
126 views

How should an object that uses composition set its composed components?

After struggling with various problems and reading up on component-based systems and reading Bob Nystrom's excellent book "Game Programming Patterns" and in particular the chapter on Components I ...
1
vote
1answer
67 views

Child object free movement on Parent object

Just to be straightforward, I am completely new to many aspects of coding and am searching for different specs and guidelines to aid me on my journey to crafting a wonderful game in Epic Games' Unreal ...
0
votes
2answers
132 views

2D Rendering in DX11. Texture Storage and Reference

I'm trying to think of the best way to manage textures in my 2D game. First, I am using DX11, so right now my "textures" are just pointers to a ID3D11ShaderResourceView created by ...
1
vote
1answer
41 views

Draw a rotated rectfill in Allegro 4.2?

I'd like to use Matricies to transform primitive geometric shapes and draw them using the Allegro library using version 4.2 (I can not switch to 5.x just yet). This works fine for non-filled objects ...
1
vote
0answers
59 views

AddFontMemResourceEx and D3DXCreateFont corruption

I'm trying to load a font from a buffer using AddFontMemResourceEx and then creating a D3D font with D3DXCreateFont. This works fine on every platform except Windows XP, where it causes the wrong ...
1
vote
0answers
63 views

Different way to pass uniforms to seperate draws in glMultiDrawElementsIndirect

Given OpenGL version 4.3 and GLSL 430, what would be the best way to pass a matrix to each model in a draw call to glMultiDrawElementsIndirect? I am thinking of going the way of a TBO and indexing it ...
6
votes
2answers
328 views

What's the largest “relative” level I can make using float?

Just like it was demonstrated with games like dungeon siege and KSP, a large enough level will start to have glitches because of how floating point works. You can't add 1e-20 to 1e20 without losing ...
1
vote
0answers
29 views

Panning in Direct sound wthout using SetPan function [closed]

I was wondering if it is possible to pan a WAV file in direct sound without using the SetPan function. If so how? That is change the volume on 2 different speakers, right and left, to simulate that ...
-2
votes
2answers
208 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 ...
5
votes
1answer
113 views

Replacement for XNA Lobby?

I am looking to implement with the Microsoft Windows Live game lobby. Since Microsoft has deprecated XNA, I am wondering if it is still possible to interact with the game lobby they provided in XNA ...
3
votes
1answer
171 views

How can I implement a dialogue where the words appear as if they were being typed?

I'm planning on putting a dialogue system into my game, I don't really work with surface so my way of implementing SDL_Ttf is by turning it into a texture, in other words, every paragraph would be ...
6
votes
4answers
4k views

Object-Oriented OpenGL

I have been using OpenGL for a while and have read a large number of tutorials. Aside from the fact that a lot of them still use the fixed pipeline, they usually throw all the initialisation, state ...
0
votes
1answer
38 views

What does this FVF value in the FVFData block of an .X file equate to?

I'm trying to read and ultimately write a mesh from/to file. This mesh has 2 sets of texture coordinates. The second set I know are held within the FVFData{} block of the .x file. The second set of ...
3
votes
3answers
4k views

Is there a good cross-platform C++ vector graphics library out there? [closed]

I'm making a game and want to use vector graphics. I started re-coding it using Cairo and the performance is horrific. So, I'm looking for a different library. It needs to be for C++ and ...
0
votes
0answers
86 views

How do I find the camera direction vector for 3D sound purposes? (C++, DirectX)

Question I'm trying to make a sound class for playing 3D sound effects with DirectSound and DirectX, without using DirectSound's 3D libraries. The plan is to have every game object constantly play ...
0
votes
1answer
149 views

ECS and life management of entities

I am done with my game's framework and I am trying to implement a life-management system. My framework so far has: Systems that hold pointers to the Entities they are interested in. An Engine ...
0
votes
1answer
96 views

Making particles accelerate toward a mouse point

I'm currently working on a particle simulation program that makes pixels move towards a mouse point continually accelerating, but i'm running into some math issues. Currently my particle will ...
2
votes
2answers
237 views

Orthographic Zooming with 0,0 at top/left

I'm trying to implement zooming on my 2D game. Since it's using orthographic projection, I thought it would be easy to implement zooming. After looking around the internet, I found a bunch of ...
0
votes
1answer
44 views

assets access with index offsets

My question if about resource management. Is it a good idea to store resources like Sounds in an array and then make a second array(lets call this SoundCollections) as a sort of reference table(name + ...
0
votes
2answers
82 views

irrlicht: drawing two textures with draw2dImage issue

Im just starting out with irrlicht (and c++) for 2d development and I followed the 2d tutorial, so I am able to draw a 2d texture on the screen (With draw2DImage) this seems to work fine. So I made a ...
0
votes
3answers
217 views

Line of sight on a 2d grid

I've been looking for similar questions here and on google, but none have worked for me yet. I have a game, where I have a 2d array of square tiles (they're objects with accessible x and y pixel ...
0
votes
1answer
103 views

When should I use instancing versus a constant buffer?

I've heard something about instancing and understood it's useful for drawing the same object many times with slight changes. It's faster because you call the draw function once per frame and update ...
2
votes
1answer
207 views

How should I traverse entities and components for their per-frame updates?

I am implementing a simple entity/component-based engine in C++ and am unsure about the best way to store references to entities/components and what the best way to traverse them each game step would ...