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

learn more… | top users | synonyms

3
votes
1answer
148 views

How do I render from one render target to another?

I have two render targets: a fake backbuffer; a special render target where I do all my rendering. a light render target; where I render my light fx. I'm sure I'm rendering correctly on both. The ...
2
votes
1answer
415 views

Not able to change the background of the scene in cocos2dx android

I have started Game Development using Cocos2d-x. And started with HelloWorld sample game. I am able to run this sample game. But when I try to change the Background Color, I am getting error in ...
2
votes
1answer
320 views

OpenGL Fast-Object Instancing Error

I have some code that loops through a set of objects and renders instances of those objects. The list of objects that needs to be rendered is stored as a std::map>, where an object of class ...
1
vote
1answer
160 views

Using unordered_multimap as entity and component storage

The Setup I've made a few games (more like animations) using the Object Oriented method with base classes for objects that extend them, and objects that extend those, and found I couldn't wrap my ...
1
vote
1answer
344 views

glsl shader to allow color change of skydome ogre3d

I'm still very new to all this but learning a lot. I'm putting together an application using Ogre3d as the rendering engine. So far I've got it running, with a simple scene, a day/night cycle system ...
1
vote
1answer
216 views

Calculating shadowmap coordinates for cubemap in shading pass?

I'm trying to implement shadow mapping with cube maps. I believe I've done the first stage by filling the cube map, but for the final shading pass I am unsure how to exactly calculate the cubemap ...
0
votes
0answers
27 views

How do I update a static mesh in Unreal 4 during movement?

I would like to use UE4 for rendering of a huge world. During the runtime, I would like to load a mesh from a custom source and adopt the mesh in the game. Could someone give me a hint how to do this ...
0
votes
0answers
160 views

Procedural Tilemap generation

So i'm building a 2d game but i have never really done any procedural generation i followed the SFML tutorial for tilemaps and i have the maps loading what i know want to know is how can i convert the ...
0
votes
0answers
247 views

CocoStudio + cocos2dx 3.2 correct way to import animation?

After many frustrating hours I came to the conclusion that there is no valid way to implement a cocostudio animation, as CCArmature is deprecated and didnt work for me anyway. CocoStudio.h and ...
0
votes
0answers
86 views

cocos2d-x .. How to detect which sprites are underneath a touch event

I was wondering what the best solution is in the following scenario: Lots of sprites floating around on screen. A user can touch one sprite and drag to another sprite. Throughout this entire time, I ...
0
votes
0answers
122 views

Problem when using two different shaders

I have created a simple shader for drawing my scene in OpenGL. When another shader was introduced, a problem appeared. I use the first shader and draw few objects in the scene. Then I use the second ...
0
votes
0answers
43 views

DX9 system crash on Intel Atom CPU Z530 with Intel GMA 500

our project has to run on a very specific hardware, which is listed below: WinXP Professional 32bit Intel Atom CPU Z530 with Intel GMA 500 (2 CPUs, 1.6Ghz, 512 MB RAM) DX 9.0c 800 MB swap memory ...
0
votes
0answers
70 views

Tile Collision - subtracting a minor value to the box size

I'm having a certain problem when doing collision checks on bounding boxes that have their edges aligned with upper or right tiles. It shouldn't count as an intersection but I don't know a good ...
0
votes
0answers
78 views

FBX SDK Colors problem

I've imported control points, normals, and indices successfully and now i'm trying to import vertex colors, but something is not right. Here's the code: FbxLayerElementMaterial* ...
0
votes
0answers
42 views

DirectX9 Normal/Bump Mapping Weird Texturing Artifact

As you can see the artifact here is like a triangle of the mesh getting more light. The important part of my code is below. This is the vertex declaration. VertexElement[0].Stream = 0; ...
0
votes
0answers
84 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
79 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 ...
0
votes
0answers
44 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 ...
0
votes
0answers
95 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
0answers
41 views

2D Quads Depth Rendering (DirectX11)

Ok. Did the searches, found some answers that weren't related and a lot of answers telling people to search... Sooo, anyway, pretty simple question. Just looking for a simple answer, no need to go ...
0
votes
0answers
59 views

Bounding box center after transformation - want degree values for GUI

Similar to my previous question, I have a bounding box that I have transformed and scaled. Now, I want to get its center by doing this operation and store this value. bbCenter = glm::vec3(bbMin_x + ...
0
votes
0answers
51 views

Focus a turntable style camera on an object

I have a turntable style camera in the maya / blender / alembic / opensubdiv example. I want to be able to match the camera translation to any objects translation pivot point in the scene and then ...
0
votes
0answers
31 views

Calling interactivity functions from object classes

Let's say I have a class object_door. An instance of said class is now in the game world in a locked state. Now to enable the player to open it, he needs to attempt to pick the lock. So I was ...
0
votes
0answers
35 views

alBufferData() sets AL_INVALID_OPERATION when using buffer ID obtained from alSourceUnqueueBuffers()

I am trying to stream audio data from disk using OpenAL's buffer queueing mechanism. I load and enqueue 4 buffers, start the source playing, and check in a regular intervals to refresh the queue. ...
0
votes
0answers
325 views

Cocos2d-x , setup the debug environment and remove the red marks in my eclipse

I am struggling with this issue since last week. I still can’t figure out where is the error. My code is compiling perfect if I restart the eclipse. but, when I edit the c++ file it shows red marks ...
0
votes
0answers
151 views

How to make an Game Intro

How do I display my logo (a short video) before displaying the main menu? For example when you start Call of Duty, it displays the IW / 3ARC logo, Activision, and then a cinematic. I just need to ...
0
votes
0answers
130 views

Separating Axis Theorem Issue

I am trying to create a 2d top down shooter using DirectX 11 (Windows 8 Store) and I am trying to implement OOBB collision using the Separating Axis Theorem. However I appear to have run into an ...
0
votes
0answers
62 views

Exporting .bullet file from Blender Render

I'm trying to export my blender render bullet world to a .bullet file. Unfortunately, it seems like when I bring my bullet world to the game engine it drops the bullet info. Is there a way to export ...
0
votes
0answers
363 views

How can I load an SVG file and create a shape and collision data from it?

I'm looking to write a game in C++ with vector-styled graphics. For this, I will need to turn an SVG shape into a Box2D body and a polygon for rendering in SFML. I don't need the full capabilities of ...
0
votes
0answers
102 views

How can I align a 2D object properly using tilemap collision

I'm making a mario clone, and I have been working on the collision but I can never seem to get it right. I started out with "true/false" collision, aligning the player at it's last position, and as ...
0
votes
0answers
44 views

Easier way to clip a spritesheet

I have been learning OpenGL slowly for the past few weeks through LazyFoo's tutorials, and I've come to the texture clipping section. I think his explanation is fine, but not quite enough for me to ...
0
votes
0answers
152 views

Why does Assimp appear to be loading vertices in the incorrect order in this code?

I'm getting a weird bug in my code that is reading in the vertices from an .obj file. The .obj file is just a cube, hence there are eight vertices. When I print out the vector it seems to work ...
0
votes
0answers
171 views

Bullet Physics Raytrace Picking

I'm having trouble picking using bullet's raytrace code Here's what I have so far for creating the actual Ray float top = 1.f; float bottom = -1.f; float nearPlane = 1.f; float tanFov = (top - ...
0
votes
0answers
140 views

DirectX 9 Blank Screen after Window Loses Focus

I have an application that uses DirectX9. I have 2 viewports( device swapchains ) to which I render geometry. If, during runtime, I click on a different application's window and then later try to ...
0
votes
0answers
132 views

Directx 11 not drawing scene despite all math being correct

I have a graphics engine that i writing in Directx11 and I changed the way objects are drawn, and the way assets for the game are loaded. Everything in my draw call is set correct and I thought that ...
0
votes
0answers
156 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 ...
0
votes
0answers
62 views

W2S, worldtoscreen from Projection Matrix and View Matrix

After a couple of days of tremendous trial and error coding, I must give up: I have a simple 3d program that I'm adding a visual layer to. Basically, I want to draw 2d icons and text over 3d objects ...
0
votes
0answers
176 views

Component Based Entity Design how to handle rendering in tiles

I am testing Component Based Entity System for a text based RPG game (I want to convert it to 2D in the future. this might sound crazy idea but the purpose of this forum isn't about that :) ). I have ...
0
votes
0answers
153 views

Radiosity using a hemisphere

I'm working on a radiosity processor. I'm projecting scene geometry onto a hemisphere at a high order of tessellation during a visibility pass onto a 1024x1024 render target. The problem is that the ...
0
votes
0answers
109 views

cocos2dx and tweenings libs

I know cocos2dx has built-in actions like move-to, etc... to do some kind of tweening but haven't seen any way for example to add different easy ins and outs. Browsing the documentation haven't found ...
0
votes
0answers
130 views

Getting current time in milliseconds

How to get the current time in milliseconds? I'm working on a hacking simulation game and when ever someone connects to another computer/NPC, a login screen popups with a button on the side called ...
0
votes
0answers
240 views

Space Strategy Ship Movement Math

This is similar to a question I asked a while ago, but I phrased it so terribly so might as well start over. I am trying to implement ship movement in 3D space, but confined to a 2D plane at y=0 (see ...
0
votes
0answers
174 views

Using shaders with GLFW3

i've setup the newest version of glfw & glew on mingw (i'm using windows 7). I've previously used freeglut & glew but i switched to glfw because i've heard it was better for games. So my ...
0
votes
0answers
93 views

Tension Force is zero

And it's not supposed to be. I've been pulling my hair out for a while trying to figure out why... The values used in T = F - ma are below: mass of first body: 1 kg acceleration: [0, 9.80665] (as a ...
0
votes
0answers
299 views

GLSL gl_ModelViewMatrix breaks my code?

So I have the following shaders which work (to the extent that they are completed anyway). //Vertex Shader uniform float offset; void main() { gl_TexCoord[0].t = gl_MultiTexCoord0.t; ...
0
votes
0answers
263 views

Ideas to create a Best Move in a match 3 game

I'm trying to make a match 3 game in C++ and I want to make a best move method to show the player the ideal position to move to get the most amount of points. The rules of the game are as follows: ...
0
votes
0answers
1k views

Getting Image From URL , Using curl in Cocos2dx C++

I am using curl in C++ to get an Image from a URL for a Cocos2dx Game. The Code is Working Fine. And using CCImage And cocos2d::CCTexture2D I create a Sprite and Add it on my Layer. The Sprite is ...
0
votes
0answers
1k views

How to do collision detection in 3D using bounding boxes?

I am using c++ in visual studio 2010 with opengl. I am trying to make a programme that has 2 boxes that are able to be stacked on top of each other but I am having some trouble with the collision ...
0
votes
0answers
165 views

Simulating smooth movement along a line after calculating a collision containing a restitution of zero in 2D

[for tl;dr see after listing] //...Code to determine shapes types involved in collision here... //...Rectangle-Line collision detected. ...
-1
votes
0answers
25 views

changing the color of gl_quads inside loop

I am trying to make a chess board with black and with quads , it should display black and whiote alternate quards but its not doing that for some reason here is my code #include <glut.h> void ...