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

learn more… | top users | synonyms

0
votes
1answer
44 views

Transformation problems with hardware instancing in DirectX 11

I'm getting some wonky geometry in my application when trying to use instancing. I'm not sure if I'm doing the mapping of my per instance data wrong. This is how my mapping looks like: XMMATRIX scale ...
0
votes
0answers
32 views

Run Simple HLSL Pixel Shader with DirectX 9

I'm trying to run HLSL Pixel Shaders with DirectX 9 where I feed a texture in, run the HLSL code and copy the resulting texture back from memory. I think I'm getting pretty close, although a LOT of ...
0
votes
0answers
39 views

Using a Unity RenderTexture in a native plugin (4.6.1)

I am trying to create a RenderTexture in unity, but I want to update it using a plugin. I am doing this on Windows 7 Pro 64bit and I wrote the plugin using VS2010 professional. Here is the code in ...
1
vote
1answer
72 views

Screen tearing in emulator

I'm trying to make a game boy emulator, and I'm using Windows for the graphics (StretchDIBits). I'm getting screen tearing like this. I tried enabling vsync in graphic settings but nothing changed. ...
0
votes
1answer
7 views

Is GetFixtureA() of b2Contact guaranteed to return the body on which GetContactList() was called?

For example, in the code below, will the assert ever fail? for (const b2ContactEdge *contactEdge = playerPhysicsBody->GetContactList(); contactEdge; contactEdge = contactEdge->next) { ...
0
votes
2answers
110 views

C++ Saving and Loading From Text File

In my C++ program I am trying to develop a simple saving and loading function for my game. I can easily get the save function on it, but the loading part of it really stumps me. What I need is to ...
1
vote
2answers
156 views

How to render tile maps in modern opengl?

I'm trying to use SDL2 and Modern OpenGL to make a 2D rpg. The problem is, I have no idea how to render a tile map. I'm using the Tiled map editor to create maps. I have a vague idea of how to parse ...
-1
votes
1answer
42 views

Applying velocity to objects in a specified direction

How to apply velocity to a particular direction? Data which I have: object position (P1) destination (P2)
1
vote
2answers
49 views

Runtime Error dealing with SDL_Events

I do not know if this is the best way to handle these SDL_Events, but I am attempting to create a very abstract and generic code that will update my Game Object. Basicly I have a Scene which in my ...
0
votes
1answer
47 views

Will DirectCompute run this HLSL code

I found a sample about how to run a HLSL code with DirectCompute. https://code.msdn.microsoft.com/windowsdesktop/DirectCompute-Basic-Win32-7d5a7408 This is the HLSL script I want to run ...
1
vote
1answer
99 views

Run HLSL in C++ Basic Sample

I'm considering the idea of taking shaders written in HLSL and running them in an AviSynth plugin to process videos. This would allow accessing various shaders, and also to have GPU acceleration. I'm ...
0
votes
1answer
97 views

How can I implement a quaternion camera?

I am trying to implement a quaternion camera in OpenGL 3.3. I have so far used these tutorials below however I have a bug which I cannot work out how to fix. ...
0
votes
1answer
86 views

OpenGL texture seams

I'm atempting to make a game using OpenGL. So far I have loaded an .obj model, and I have generated a terrain as well as a very simple UI. My issue is that it 'seams' (tihi : P) that there are some ...
0
votes
0answers
19 views

How can I get float values using glReadPixels? [Android NDK es3.0]

c++ code: float* data = (float*)malloc(texWidth*texHeight*sizeof(float)); // or GLfloat float* result = (float*)malloc(texWidth*texHeight*sizeof(float)); // or GLfloat for (int i = 0; i < texWidth ...
0
votes
1answer
57 views

Tile map collision C++, SFML

My problem with the collision here is more to do with how to decide which tile the player is in. Each quad of the map is 16 pixels squared (Vertex array), and the player moves in 1 pixel jumps. ...
1
vote
2answers
68 views

2D platform collision

I have went over and over in my head for the past month trying to get a simple platformer together. My problem is collision. So far from every tutorial I've found this tilemap based collision needs to ...
1
vote
1answer
44 views

ETC1 Support on android alpha problem (GLSL cocos2d-x)

I want to support etc1 in my game, but somehow it doesn't work (I'm using cocos2d-x C++ GLProgram* glp = new GLProgram(); glp->initWithVertexShaderFilename("testv.vsh", "test.fsh"); ...
0
votes
1answer
48 views

GL_INVALID_OPERATION on glBindVertexArray Despite glGenVertexArrays()

so I've been trying to create a simpler way to draw polygons and and have come across the following issue: When I call glBindVertexArray(m_VAO); it throws a GL_INVALID_OPERATION even though I have ...
0
votes
2answers
85 views

How to design parameters for events

I'm working on the event system for my engine, and have some trouble deciding what types of parameters my events should have to be both generic and specific at the same time. I want to be able to ...
-1
votes
1answer
51 views

C++ SFML and Box2D: Move world or move player?

I'm currently making a top-down shooter game and it's my first time developing with SFML. I came across and issue and I want to know if there is a better way to solve it. I need to get the "camera" ...
1
vote
1answer
86 views

Efficient container(s) for units in an 2D RTS game

As the title says, I'm toying around with developing a 2D space RTS game. All of my units are spaceships that basically just shoot at one another, but they have to do a variety of other things as ...
0
votes
3answers
83 views

Grid Programming: Selecting a tile returns a negative coordinates

Let me explain what I am doing here. I created a class template named as PlayField where T is the type of the GridObject. I wrote this class using Cocos2dx. The point of this class is to make it easy ...
0
votes
1answer
103 views

What is the correct approach to implement multiplayer in a game? [duplicate]

I'm developing a game and it is intended to be a multiplayer game. I have experience in writing servers and clients in Java, but the game is written in C++. The server will be written in Java for ...
1
vote
1answer
40 views

Environment mapping - cube mapping using OpenGL

I'm trying to do cube mapping. Problem is that I'm getting this: This is what I get when I rotate it: But it should look like this Here is code for vertex shader varying vec2 tex_coord; void ...
0
votes
0answers
46 views

How to achieve Anisotropic filtering x16?

I'm using directx and I've achieved x1 anisotropic filtering, however regardless of the maxanisotropy value I set, it's still only x1. If someone could help me figure it out i'd greatly appreciate it. ...
0
votes
0answers
31 views

Buffer resource as shader resource view

I am trying to build a shader that change the output color according to something that happen in my c++ code In my code I create a buffer with four element(each element containe four float - RGBA) ...
0
votes
2answers
67 views

Texturing without D3DX

Well, i have been online for hours looking for solutions, but i have found none. Im looking for a way to create textures without the function D3DXCreateShaderResourceViewFromFile. Since D3DX is ...
0
votes
1answer
66 views

Rescale pixel art scenery before rendering in SDL2

I looked at this page that mentions the SDL2_gfx library for rescaling SDL_Surfaces without the image getting blurry: SDL zooming/upscaling without images becoming blurry? I wanted to know if it was ...
1
vote
0answers
52 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 ...
0
votes
3answers
120 views

Loading models with opengl

I'm developing a video game using OpenGL as graphic API and C++ programming language, and I'm creating all models with blender. One question I have is how you deal with models (vertices), I mean, ...
1
vote
1answer
55 views

How to debug a GLSL shader? [duplicate]

I cannot find any tutorial in Google and Youtube. I have a C++ program that uses OpenGL ES 2.0 API to render something on the screen. How can I debug my shaders? Any step-by-step guide? What is the ...
2
votes
1answer
55 views

Transition between normal and slow motion

I have a game (C++) in which I want to transition between two speeds of motion. For illustration, the player raises their weapon to aim, and whilst this is in progress over a known duration, time ...
1
vote
1answer
42 views

Deterministically shuffling of array

I couldn't find an answer to this so I'm asking here, I've made a voxel engine and it's working reasonably well, except for a small detail: I have yet to figure out how to seed my simplex noise ...
1
vote
0answers
24 views

Forking vanilla Doom 3/id Tech 4 for proper sound timing [closed]

I've been enjoying Doom 3 modding lately. but one thing that's been rubbing me the wrong way was the way sounds played exclusively at regular intervals completely dissociated from the weapons' ...
0
votes
1answer
59 views

How to put the “camera” inside a cube in OpenGL

I'm really new to OpenGL and can't seem to figure out how to put the "camera" inside the cube I've created so that I can move in an FPS-like style. I tried to use gluLookAt and gluPerspective but I'm ...
4
votes
1answer
810 views

32 Bit colors difference

Im going through a tutorial to create a basic directx framework, and i've noticed that in there (and other tutorials, when i checked out) use DXGI_FORMAT_R32G32B32A32_FLOAT inside the input element ...
0
votes
1answer
83 views

How to use PhotonPeer in Unreal Engine 4.8

I'm trying to implement PhotonPeer in Unreal Engine 4.8 but I'm stuck at the connect function. I need to provide an AppId, but nothing I try is accepted by UE4. Here's my code: DALGameInstance.h // ...
1
vote
2answers
236 views

How can I calculate the future position of my moving object?

I'm relatively new to games development and I have a 2D game where the playing area is an enclosed rectangle with width w and infinite height. In the playing area there is a ball. A gravity force of ...
0
votes
1answer
65 views

How to get `Label::createWithTTF` to support RTL languages such as arabic

Firstly, I'm using Cocos2d-x v3.6, Visual Studio 2013 uses(UTF-8 without signature option) and C++. When using Label::createWithTTF method to write Arabic text, It appear like the following. ...
1
vote
1answer
68 views

Event-/Input system with SFML: Cannot move diagonally in 2D

I am a beginner in anything with game development. I written a small prototype in which i can move a square around with the arrow keys. For that i use SFML. At the moment i experiment around with my ...
1
vote
1answer
39 views

SFML Library Not Rendering Sprite Texture Updates When Accessing Sprite From Lower In Framework Heirarchy

So currently I am working on a framework for a game utilising the SFML graphics library and in one of the classes representing a renderable object in the framework there is an sf::Sprite that is used ...
1
vote
1answer
66 views

Keyboard input vs character movement encapsulation

In our game created with c++ and sdl we are having difficulty delegating how the main character should be controlled. We have a keyboard class and a sprite class for the main character, but are ...
0
votes
0answers
134 views

Using Cocos2dx with Android Studio

Has anyone got Android Studio to work with Android Studio? I can get the generated project to work with proj.android, and add the NDK path to local.properties but I can't get it to rebuild after I ...
2
votes
2answers
63 views

Assigning IDs to entities and obects for use in scripts and by other objects

I'm currently planning a small, simple scripting system for my game engine that will allow me to easily define scenes (similar to the "cutscenes" found in 2D RPGs). It consists mainly of simple ...
0
votes
1answer
34 views

Cannot Get The Texture Showed Up Correctly glDrawElements

I still have this problem almost 1 month. Tried to search on Google but did not find any solution to this. I have loaded all the data correctly but don't know why the texture came up like this. Here ...
1
vote
0answers
79 views

How to build a static version of cocos2d-x and link it to my project

Firstly, I'm using Cocos2d-x v3.6 for Win32 desktop + Visual studio 2013 and C++. When building Cocos2d-x, always it has been built as a dynamic version not a static version as I want. How to ...
0
votes
1answer
51 views

Cocos2d-x project every time must compile the project plus other libraries

I'm using cocos2d-x v3.6 for win32 desktop and Visual Studio 2013 with c++. When I change the code and then compile the project again, I must re-compile my project AND other libraries every time ...
1
vote
0answers
84 views

Implementing a Render queue [closed]

I am currently in the process of re-writing my 3d engine, and I am looking at improving the renderer. I have read that organizing objects into a "render queue" and sorting is the best method. The ...
1
vote
0answers
43 views

Generating a grid (Array) of Tetris Pieces [duplicate]

What I want to do is quite self explanatory. Just like the title states. I want to code something that will generate a grid which contains is filled of Tetris pieces. However some conditions must be ...
0
votes
1answer
67 views

Game Controller that is constantly changing

I'm writing a game where the main character is a ghost, and therefor can possess just about everything. The problem is, I'm not sure how to efficiently & effectively handle the changing actions of ...