Tagged Questions

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

learn more… | top users | synonyms

1
vote
0answers
115 views

2D Rotation Transform Matrix Issues

I'm stuck on my computer graphics class homework. I'm sorry if this is not right place to ask. I think this is closest thing to computer graphics. My assignment is to create basic 2D colored ...
0
votes
0answers
60 views

Assimp - Error loading .obj files

I'm trying to load .obj files in my little game. I decided to use assimp as tool to import those models. But it seems that assimp does not import them correctly. I looked for a simple cube mesh ...
3
votes
1answer
130 views

Fighting Game Camera Positioning in SDL

I'm working on a 2D fighting game (using SDL) much like the original Killer Instinct on SNES. I want the camera to keep both players an equal distance from the left and right sides of the viewport. ...
-2
votes
1answer
83 views

What is the advantage of 6 Directional Movement vs, for instance, 8 or 4 [closed]

I'm making a fallout 2 inspired game and I'm wondering what you guys think about its use of 6 directional movement. It kind of bugs me for some reason and seems like it would make game play odd and ...
3
votes
5answers
266 views

Is it bad practise to have an object for every tile?

In the game I am working on, many of my tiles must have special attributes (such as triggers when the player steps on them). I was wondering if it would be bad practise to create an object for every ...
0
votes
0answers
53 views

Use other IDE then Eclipse on OSX for game dev with Cocos2dx for Android

I've started with cocos2dx 3 days ago and already having a massive pain in my "back" with this support of C++ that eclipse provide me. It support it a little bit more then notepad++, and after years ...
1
vote
1answer
31 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
39 views

C++ Visual Studio Sprite Animation Function only setting values for certain Rect structs in SDL

I'm making a game in SDL and I am using an Array of Rects to store values of sprite sheet clip's dimensions. When I call the function and pass in one of my sprite sheet textures with it's ...
2
votes
1answer
165 views

How do I call OpenGL methods that require pointers in C#?

I have found the following C++ code in this tutorial to draw a triangle with OpenGL 4: float points[] = { 0.0f, 0.5f, 0.0f, 0.5f, -0.5f, 0.0f, -0.5f, -0.5f, 0.0f }; GLuint vbo = 0; ...
0
votes
0answers
27 views

Intersection issue with box2d in iOS

I'm trying to use the code here http://www.iforce2d.net/b2dtut/raycasting So I can know whether a line cross a box2d object or not. It half works, in that when the line crosses the object it does ...
0
votes
1answer
107 views

OpenGL / Soil Image Loading Difficulties [closed]

The Problem I am attempting to load and display an image in OpenGL using the SOIL library. I originally started with lodePNG but I had difficulties getting the image to display so I assumed it was ...
0
votes
1answer
57 views

Cocos2d-x how to draw in specific free form area

Here https://github.com/mikeccy/cocos2dx-finger-paint/blob/master/Classes/HelloWorldScene.h and https://github.com/mikeccy/cocos2dx-finger-paint/blob/master/Classes/HelloWorldScene.cpp you can see how ...
1
vote
0answers
29 views

How to custom file formats work, encryption, packing etc [duplicate]

So say I take an example from Telltale games, they pack all their file assets into ttarch files, now I guess this is a custom file format that allows many file assets such as dds, jpg, bik, wav, 3ds ...
0
votes
2answers
87 views

Strange quaternion rotation

I was implementing some quaternion rotations in too my infant 3d game engine and the rotations were really strange? Excuses my cluelessness. Anyways this is what I have: static XMVECTOR ...
0
votes
2answers
114 views

How to detect collision between two directed object?

I'm currently writing a game which is like Battle City game. But right now I'm facing a trouble involved to checking collision between two objects. This is the code that I wrote: ...
-2
votes
1answer
119 views

GLSL- How to change a certain color of a sprite, to another color passed into the shader?

I have been googling for over an hour, trying to find out how to do something very simple, which I see in tons of games. I tried to understand GLSL, but it seems like a ton of learning for a single, ...
0
votes
2answers
96 views

Quaternion Rotation Help

So I'm making a little engine with DirectX 11 and C++. (Some other help from other API's as well) DirectX has this function XMMatrixRotationQuaternion(XMVECTOR quaternion). I know nothing about this ...
1
vote
2answers
139 views

How can rotate a 2D textured quad in legacy OpenGL immediate mode?

I have a texture of a tank, and I want to it appearance on the screen depends on its current direction, so I decided to use rotating texture functions of OpenGL. I followed some advices through Google ...
-1
votes
2answers
141 views

What does a C++ expert need to know? [closed]

so the other day I was looking for jobs in the gaming industry (software engineer/game programmer/gameplay programmer, etc) just to get a look at what are some of the requirements. Most of these jobs ...
7
votes
3answers
292 views

Cache misses and usability in Entity Systems

Lately I have been researching and implementing an Entity System for my framework. I think I read most articles, reddits and questions about it that I could find, and so far I think I am grasping the ...
0
votes
1answer
67 views

Constant buffer not updating

I'm trying to rotate models independently of each other however I cannot for the life of my figure out how. I have gotten to the stage of writing this: std::vector<int>::size_type st = ...
4
votes
0answers
69 views

Ogre PSSM Grass Receiving Shadows

So I made the switch to Ogre3D (v1.7) and using PagedGeometry. What I'm trying to do is make a simple scene with a terrain, some trees and grasses. In a nutshell, I would like to achieve this kind of ...
0
votes
1answer
92 views

OpenGL segfault in DrawElements

I've asked this question on regular StackOverflow but without much success yet. The below program produces a segfault on the call to glDrawElements. I've looked at my max and min index values and they ...
1
vote
2answers
285 views

Directx fbx loader

I am trying to build a game with animation in c++ with DirectX. I have some fbx files with animation that I want to integrate in my game. But I do not want to draw the fbx files as a FbxScene or ...
0
votes
1answer
52 views

Diffuse Maps and DirectX

How would I load two diffuse maps onto one mesh. I have a mesh with multiple sub meshes but each one of those sub meshes has a vertex buffer and I don't think that's very efficient. How could I have ...
1
vote
1answer
107 views

How to handle game objects in DirectX

Coming from XNA, I would use the content pipeline and create XML files for game objects. However, if I changed something in the XML, I would need to do a rebuild of the project so it will create the ...
0
votes
1answer
52 views

How to move a body from one world to another?

I have a Box2D world for each level in my game. When a level is completed, I want the player to be removed from the completed level's world and added to the next level's world. How do I do this?
0
votes
2answers
172 views

Handling player and AI in a component based structure dynamically?

I'm trying to find a way to allow both input and AI to call actions of an actor in a component based structure for a 2d turn based game. The actions make use of the components. To keep the system ...
0
votes
4answers
226 views

Why use compression such as zlib? [closed]

Compression and encryption are different things AFAIK, so why even use compression if you have to still decompress anyway, is this just to reduce distribution size or is there some other reason?
0
votes
1answer
75 views

Simple shader for sprite interface [closed]

I have been looking for any examples for a long time, I cant get anything to work (from the examples). I have tried using vertex/pixel shaders, effects files, but they never have any effect on the ...
0
votes
1answer
102 views

Ambient occlusion: Correct culling after anisotropy correction

I've added simple color based ambient occlusion to my game. First it looked like this (from giawa.com): The description: "Due to anisotropy, the ambient occlusion shading on the top left is ...
3
votes
1answer
234 views

OpenGL - Drawing multiple meshes at once using VBOs and IBOs

I have been learning OpenGL 2.1 but using shaders, VBOs, IBOs, etc. I have gotten a rendering engine that can load and draw meshes, materials, forward lighting (no shadows yet), SceneNodes, and ...
1
vote
0answers
94 views

OpenGL - Texture disappears

I'm making a simple program with C++, SDL and GLEW. So far it is going great but I ran into a weird problem. One of my four textures would not show up on screen even though it used the same code as ...
1
vote
1answer
182 views

Simple framerate counter?

I'm making a first person shooter, and I've seen questions like this before, but the answer is either overly complicated or they're using SDL, GLFW, GLUT, or something else. I'm not using any of that. ...
3
votes
1answer
165 views

glm direction vector rotation

I'm working on a flight simulator, but I'm stuck with my airplane orientation. I tried some things but noone worked correctly. This is what I have : To be able to move it and roll it around himself, ...
0
votes
1answer
63 views

accelerated curved bounce

I'm trying to make a simple pong clone and want the ball to curve when the racket was moving on hit. To test out curves I removed all the rackets and just have a ball bouncing around in a rectangle, ...
0
votes
0answers
86 views

Error while loading PNG file with SDL2

I have been building a small game using SDL2 and C++ and started getting a weird error when trying to load a PNG. The error reads: libpng warning: Out of memory libpng error: IDAT: insufficient ...
1
vote
0answers
65 views

How to rotate enemies on 2D radar and clip them to circle shape? [duplicate]

I've been working on implementing a 2D radar for a 3D game lately, it's working fine in a very basic version. This is what is looks like: It works by transforming the 3D coordinates of the enemies ...
0
votes
2answers
164 views

What does “~” in front of a function name inside a class mean? [closed]

I added a class using the 'add class' item in Visual Studio Express and it generated two functions in the .cpp file with the same names. But the second has the ~ character in front of it. What does ...
0
votes
1answer
145 views

Rendering multiple meshes in directx11

Recently I have tried adding rendering with multiple meshes in my program. This did not go too well. The attempt I currently have goes like this bd.Usage = D3D11_USAGE_DEFAULT; bd.ByteWidth = ...
-1
votes
1answer
104 views

How to encode game files or pack to one file like game_data.dat [duplicate]

I am a beginner C++ programmer. I am creating a custom Open Tibia Server and I use the alternative Tibia client (OTClient). I want encode game files (image, sound, lua, etc.) or pack all files into ...
0
votes
2answers
66 views

Disable lighting in DirectX10

I'm implementing a D3D10 version of my renderer (not porting to avoid losing Windows XP support). I didn't go straight to D3D11 because MSDN and other sources recommend upgrading to 10 and then to 11. ...
0
votes
1answer
99 views

Playing a sprite sheet animation in Cocos2D-x

I'm trying to create an animation using a sprite sheet in Cocos2D-x. I'm doing the following. The game doesn't crash but the screen is still blank. bool HelloWorld::init() { ...
0
votes
1answer
63 views

Computing Field-of-View from window dimensions

I'm looking into computing the vertical Field-of-View (FOVy) based on the projection parameters of my camera. From this source, I've found an equation that seems to work. float ...
3
votes
2answers
112 views

How to detect Lagoons and Lakes on a random Island Map

I have an engine which generates random Islands. At the moment it tends to generate quite a lot of lagoons and lakes. I would like to know of a feasible way of detecting them so that I can mark them ...
0
votes
0answers
14 views

How can I animate a sprite in cocos2d-x 2.2.1 c++? [duplicate]

Is there a way to do an animation without a .plist file? I'm having a hard time doing swap animation with sprites. For example, doing an animation while the user is not doing touches and the other ...
2
votes
1answer
74 views

Informing objects within a particular state of the world state

Following the State pattern, every state in my game is a derived object that reflects a particular segment of the game (MenuState, PlayingState, GameOverState, etc.) Each of those state objects holds ...
1
vote
2answers
280 views

Entity Component System Coupling

Lately I've been working on a small personal project which is basically an Entity Component System framework with autoupdated Systems. While I have a pretty good idea on the way the framework should ...
0
votes
2answers
326 views

Is it possible to use C++ with Unity instead of C#?

The title kind of says it all. Is it possible to replace C# with C++ on a game using Unity?
1
vote
1answer
65 views

Compute billboard rotation

I'm trying to compute a matrix to have object always facing the camera. For the moment, my result look pretty good, the problem is that my original billboard scale isn't preserved (Every billboard ...