Tagged Questions

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

learn more… | top users | synonyms

0
votes
0answers
4 views

C++ Irrlicht Program doesn't link: “undefined reference to `__imp_createDevice'” [migrated]

My Irrlicht program doesn't link. The compiler I use is g++. Code: #include <irrlicht.h> int main() { irr::IrrLichtDevice *device = irr::createDevice(); // And other init stuff ...
0
votes
2answers
78 views

How to make sprites from multiple images using SDL2

Using SDL2 in C++ I can load textures with out problem however, I have sprites that are from about 15 different png's that I was hoping I could load them all up and for loop through them. However, ...
0
votes
1answer
49 views

How do I set a background image in OpenGL/GLFW?

I'm writing a simple 2D game with C++ and OpenGL/GLFW, and my current step is to create a menu. I finished with buttons, but I think it looks a little bit boring (with only 4 buttons and a black ...
0
votes
1answer
53 views

OpenGL - Asteroids clone - shooting bullets from spaceship [duplicate]

I am having a bit of difficulty figuring out how to shoot bullets from the front of the spaceship. I can draw it to screen, but I can't properly figure out how to create bullets each time I press the ...
0
votes
0answers
30 views

Getting a Rect of a SpriteBatch

I'm using DirectXTK, https://directxtk.codeplex.com/wikipage?title=SpriteBatch it's a port of XNA spritebatch. I'm trying to get a bounding rect of my sprite for testing collisions AABB. I draw ...
0
votes
0answers
32 views

How do I procedurally generate a maze puzzle? [duplicate]

I am working on a puzzle game, with procedurally generated levels. I want each puzzle to look different while making sure there is a single right path to the exit. The idea is to have objects ...
1
vote
1answer
117 views

OOP design, keeping track of entities

First, I would like to say that I have no experience with this and am still getting my head around OOP, so if something is really obvious, just point it out :) I am designing a game and I am not sure ...
-4
votes
0answers
58 views

AntiCheat Tool using C++, AntiDebugger & more [closed]

I want to make an AntiCheat tool for my game. I thought maybe check if something gets injected to the process or something was edited in it's memory. Please note, it's an extern one, so it's not ...
0
votes
1answer
32 views

FBX SDK texture file name

I have built an importer that retrieves necessary vertex data however I wish to be able to read texture file directories. How do I retrieve the texture file name?
1
vote
1answer
85 views

How to calculate ray polygon intersection? [duplicate]

I'm in a class where we are creating a ray tracer from the ground up in C++. I'm at a point where I can't seem to wrap my head around the math that is required to calculate the point at which a ray ...
1
vote
1answer
61 views

How does the SDL dynamic API inject itself in statically linked code

I've been using SDL2 for development almost since it came out. Long story short, I stumbled upon the SDL dynamic api explanation. I've looked in SDL_Dynapi.c to understand how it works. I get that the ...
3
votes
0answers
128 views

How do I handle rope physics with fixed ends and a sliding weight?

I've been interested in rope physics recently—I've successfully implemented a simple Verlet rope with moveable ends. Now I am trying something a little different: I want to start by recreating the ...
0
votes
0answers
66 views

Particle System Tracking

I have a particle system where instead of tracking the time each particle is alive, I just track the time of the oldest particle and the time of the youngest particle. Basically, the oldest particle ...
0
votes
1answer
62 views

Can't seem to get Sprite to face left in sfml c++

I am having some small issues getting my sprite character to flip around. Basically I have a character that can walk to the right.. I am looking to flip it so that it looks like it is walking left. I ...
1
vote
0answers
64 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
35 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
113 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
68 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
231 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
35 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
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
31 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 ...
1
vote
1answer
153 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
25 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
84 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
0answers
29 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 ...
0
votes
0answers
38 views

c++ factory pattern component creator with singleton container [migrated]

I'm implementing the factory pattern for component creation and want to implement a singleton container for all instances of each type created by the factory. Ideally this would be one vector for each ...
1
vote
0answers
27 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
0answers
6 views

Overriding Help [migrated]

I can't get method overriding to work. Right now I have a class called Sprite, and two subclasses; Let's call them Goomba and Koopa. Instances of Koopas and Goombas are stored in an std::list of ...
0
votes
2answers
76 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
86 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
93 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
91 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
118 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
131 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
258 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
59 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 = ...
3
votes
0answers
60 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
88 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
181 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
46 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
100 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
159 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
215 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
72 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
97 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
147 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
88 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
150 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. ...