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

learn more… | top users | synonyms

0
votes
1answer
158 views

Jittery Rotational Movement with Arcball implementation

I have an assignment where I need to implement arcball using Opengl (~2.0). I have it more or less implemented but I have a some problems/issues/bugs and I'm not sure whats either causing them or how ...
0
votes
1answer
114 views

Problem with a TinyOBJLoader Renderer

I was working on implementing a renderer for SYOYO's tiny obj loader and when it came to testing time, it failed to render. Here is an image of the result: I believe that i have made the error with ...
3
votes
1answer
144 views

OpenGL contexts

I have several questions related to OpenGL rendering and the issues I encountered while making 3D enigne. Some of them were asked before, but the answers are old and possibly outdated or ambiguous. 1)...
2
votes
1answer
93 views

Translation Matrix not working properly

Hello, I get this result when i try to scale and then translate a vec4 in my shader. I created a mat4x4 class on my own and some functions wich return some matrices for me, everything works, but not ...
5
votes
3answers
187 views

Graph search with a high number of actions

I have implemented A* to reach a goal state from a start state. My state is position X,Y, angle and others state variable. I have a number of actions. What I call actions is : A* on a grid has 4/8 ...
1
vote
2answers
46 views

OpenGL: Properly attach Texture

Problem: Been trying for hours to set a simple png of a cross hair as a texture (so I could later stick in the middle of the view like a normal cross hair), without luck. I'm coding in Java with ...
1
vote
1answer
48 views

How do I toggle color writes in SlimDX 11/Direct3D 11 with FeatureLevel 10?

I'm having trouble setting the RenderTargetWriteMask field of a RenderTargetDescription struct. I simply want to toggle color writes but every time I try to enable the the color writes are changed ...
1
vote
1answer
31 views

SDL Memory leak with TTF_Font and surface

I am creating 2D game with SDL2, and I have a problem with my label class. Every time I construct new label I have a memory leak, and I don't know what I do wrong! For example, I want to refresh ...
1
vote
1answer
60 views

How to render IDirect3DSurface9 in my window?

I have some code that captures the screen and save data into a surface. g_pDirect3D_Device->GetFrontBufferData(0, pSurface); All is ok, now I want to display pSurface in my window. I want to ...
0
votes
1answer
160 views

Integer linear program solver based AI

Is Integer Linear Programming a viable solution for a turn based game AI? My current AI solution uses an ILP solver. If you are unfamiliar with ILP, it uses a collection of Booleans to find most ...
0
votes
3answers
3k views

C++ GameState management

I have been attempting to make a game engine in C++ and have come across the dilemma of game state management. I have done a lot of research and found numerous ways of accomplishing from game engine ...
0
votes
0answers
20 views

Triangle in Directx 11 [on hold]

I recently got a triangle to work in directx 11 what exercises should I do to not forget how to do this and get a better understanding of rendering geometry?
3
votes
1answer
139 views

Passing an SDL KeyboardState(Uint8*) to Lua

I'm working on my first big project and I've decided to integrate Lua with my C++ framework. Everything's worked out so far, but the only way I've managed to pass the SDL_GetKeyboardState(NULL) array ...
1
vote
1answer
371 views

Cocos2d - Physics bodies randomly loosing Velocity along an axis after impact

This just started occurring and seems to randomly happen during, and between, game sessions. A dynamic moving body collides with a static body and instead of bouncing off looses (almost completely) it'...
1
vote
0answers
23 views

Integration of Game Loop + Physic Engine : when to delete objects?

How to manage code around physic engine, when a game object should be deleted? I will use a tiny game as an example:- 1st iteration of development I have a very simple game with 1 character (Jumper)...
1
vote
1answer
30 views

How to use GdxAI with libgdx ashley ecs framework?

I'm planning to use GdxAI Telegraph in GdxAshley ecs framework, my problem is how I'm gonna create a telegraph component if I wanted to dispatch a message? I have created AIComponent and AISystem. ...
1
vote
2answers
93 views

C++ MMO: Best approach to store creatures in a multi-level world map for the purpose to find spectators

I'm developing a game which is a multi-level game, my game can have a maximum of 15 floors, and a fixed amount of tiles width/height. Each tile in the map can have a creature. All fine until here; I ...
1
vote
1answer
87 views

Vertexquads are not being drawn in 2D space

I started teaching myself DirectX a short time ago and have come across a problem which I can't figure out by myself unfortunately. I'm trying to build my own font system, so I can draw strings in 2D ...
2
votes
1answer
112 views

Handling animations in a Platformer

I'm developing a 2D platformer game using the Cocos2d-x Engine, i can load correctly the animations according in which action the player is(running, jumping, standing, etc). Now i'm trying to add the ...
3
votes
1answer
34 views

Is this process for generating an OpenGL perspective projection correct?

I have been programming OpenGL for a while now and I have successfully created a perspective camera, however, I can't help but shake the feeling that I am doing it wrong. The code I am using is below, ...
4
votes
3answers
122 views

How can I implement a file format that allows for random access to varying-sized sub-files?

I need to store and update collections of serialized data (of varying sizes) into a single file that is compact and allows for efficient random access to the stored data. Some real world examples: ...
3
votes
1answer
430 views

Finding out the “width” and “height” of my screen after projection added

In a 2d game, doing collisions with the edges of your screen is easy. Your textures are a 1:1 mapping of your screen resolution because your verities are too.. if your x position is > than ( screen ...
1
vote
2answers
88 views

Performance Issues Using Lua in C++

I'm making an engine in C++ with Lua for its scripting language (using LuaBridge as the binding). I have a lot of entities and those entities have components. One of the components on those entities ...
3
votes
1answer
323 views

Cocos2d Sprite 3D position

When I set a position3D for a Sprite in cocos2dx, it render two times the same sprite, i took a screenshot: I set the position3D because i want to use the Z position the give an effect of distance, ...
3
votes
1answer
37 views

Optimizing black and white matrix block drawing

Disclaimer: I am uncertain if this is the best place to post this question, so please advise me of how I can best find the answer if I am doing something wrong. I am asking this question because I am ...
1
vote
1answer
23 views

Texture Wrapping isn't getting applied to my object

I have a Drawable Class, a Cube Class, and a Texture class. I feel like the texture wrapping isn't being applied due to some values being passed by reference, or just being discarded. My cube just ...
2
votes
1answer
3k views

Create a fly camera with lookAt

I want to create a free cam with the lookAt matrix in OpenGL. I just made the control with W, A, S and D so you can move around. But now I nee to look around. I thought doing that with sine and cosine ...
2
votes
1answer
306 views

How to choose and scale heuristics for A-star on a graph?

I am trying to find the best and scale my cost function for my algorithm. I am following amit blog which explain that (http://theory.stanford.edu/~amitp/GameProgramming/Heuristics.html#manhattan-...
1
vote
1answer
92 views

QT SFML Integration Trouble

I have been having trouble linking sfml to qt creator I have downloaded the pre-compiled libraries and headers for MINGW on the sfml website here : http://www.sfml-dev.org/download/sfml/2.3.2/ This ...
2
votes
1answer
98 views

C++ SDL OpenGL minimise / restore window issue

I'm partway through developing a 2D game in C++ using SDL and OpenGL; my IDE of choice is CodeBlocks. I've hit an issue that I can't seem to get around. Basically, if I minimise and then restore the ...
0
votes
1answer
62 views

drawing of heightmap gives weird single pixels

I'm working on a game where I want to generate a heightmap, however it draws a bunch of random white dots in a mostly black background, the function I have looks as following: void heightmap::layer1(...
-4
votes
0answers
21 views

Unreal crashes when opening a project [closed]

Issues opening the project. I think problem is either locating OwlGameMode file, or code in the file. I had the project open, and everything compiled and ran fine, but the project crashed when I ...
4
votes
1answer
69 views

How do I create 4 rows of SDL_Rects with each row being a different color?

So using a class i've created a vector and managed to make one row of SDL_rects(with collision detection and destroy on collision). But when I make a second row(and obviously 2 or more rows): 1) it ...
1
vote
1answer
158 views

DX9 How to Apply HLSL Shader with StretchRect

Using DirectX 9,I'm trying to run a HLSL pixel shader on video frame data while copying it from one texture buffer to another texture buffer without displaying it. StretchRect at the end is what ...
2
votes
0answers
41 views

SFML Raycasting Problem: Textures not displaying propely

I have been lurking on gamedev.Stackexchange for a while now and finally have a question to ask. I have been working on a simple raycasting engine (like wolfenstein 3d) using the SFML Graphical ...
0
votes
1answer
35 views

How to keep text on top of openGL in a perspective projection

I have a game that has a score, I found out how to render text in a ortho projection but I can find a way to mix the two, or have text stay in the same position on the screen at the same time as ...
1
vote
1answer
716 views

post on Facebook from cocos2d-x on windows phone

Is it possible to share/post on Facebook from cocos2d-x on windows phone. Is there any example/tutorial available.
1
vote
1answer
48 views

What's a way to improve this wall collision detection code to keep objects within a perimeter made of these walls

// Player Collides with Wall counter1 = 0; for (iter60 = wallArray.begin(); iter60 != wallArray.end(); iter60++) { if (Player1.rect.getGlobalBounds().intersects(...
2
votes
2answers
1k views

Drawing a continuous line with onTouchMoved callback

i'm trying to draw a continues spline on every onTouchMoved call, the functionality is supposed to be similar to the line drawing used in the iOS game - flight control. i'm using it in the following ...
1
vote
0answers
51 views

How to manage millions of game objects with a Slot Map / Object Pool pattern in c++? [migrated]

I'm developing a game server for a video game called Tibia. Basically, there can be up to millions of Objects, of which there can be up to thousands of deletes and re-creations as players interact ...
0
votes
1answer
40 views

SDL: Certain bitmap not displaying

I have come across a very wierd problem. Here is my code: #include <iostream> #include "SDL.h" using namespace std; class MyGame { public: SDL_Surface* image; SDL_Surface* window; ...
1
vote
0answers
28 views

Limit/Clamp camera movement using quaternions

I'm making a camera object for rendering with OpenGL. However, instead of using the typical "LookAt" method I'm trying to use just a Quaternion for orientation and a Vector3 for position. Instead of ...
0
votes
1answer
57 views

How to create animation using sprite sheet in C++ and SFML 2.0?

I was wondering how do animation using a sprite sheet. I have a sprite sheet and the size is height:400 width:601 The code I am using is: #include<SFML/Graphics.hpp> #include<iostream> ...
1
vote
1answer
70 views

Simple 2D Platformer Collision Detection?

I'm relatively new to programming and I am attempting to write a 2d platformer in C++ using the SFML library. The structure of my code is that I have a Stage class which contains a vector of sf::...
1
vote
1answer
77 views

Sprite Sheet Texture not being rendered

I'm making space invaders (in OpenGL/SDL) and I've run into a problem when trying to draw the sprite for the spaceship from the spritesheet. In my entity class, I have a pointer for the sprite that ...
1
vote
3answers
6k views

Altering pixel value in an SDL2 texture

Alright, I have spent a lot of time on this one, so I need some help. I like the ability to draw pixels directly to the screen, sometimes I do this to trace the path of objects for debugging etc. In ...
1
vote
2answers
426 views

Animating isometric sprites

I'm having trouble coming up with a way to animate these 2D isometric sprites. The sprites are stored like this: (Game Folder Root)/Assets/Sprites/(Sprite Name)/(Sprite Animation)/(Sprite Direction)/(...
1
vote
2answers
393 views

DirectX map/unmap

In my 2d game i want to use dynamic buffers to render sprites. My question is, when should i map unmap buffer? The 2 possibilities are: #1 //game logic map() fill buffer unmap() render() #2 //...
1
vote
1answer
65 views

glViewport and single-pass cubemap rendering

This question is related to another question of mine on StackOverflow. The problem I'm facing is that while I'm rendering to a cubemap in a single pass using a geometry shader (like I show in my ...
-1
votes
1answer
47 views

Volumetric Lighting/Light Shafts in DirectX

So currently I am trying to implement Light Shafts into my DirectX Engine. I read the Nvidia GPU Gems Article (http://http.developer.nvidia.com/GPUGems3/gpugems3_ch13.html) I am new to Graphics ...