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

learn more… | top users | synonyms

1
vote
1answer
23 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 ...
-1
votes
0answers
22 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 ...
0
votes
0answers
20 views

Passing a member function as an argument to a constructor in any class [on hold]

I've looked around on StackExchange sites and I haven't found any answer that can help me or that I understand. My issue is: I have a button class. I want the button class's constructor to take the ...
1
vote
2answers
55 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
61 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. ...
-3
votes
1answer
37 views

How can I implement vertex and edge collapsing? [on hold]

I am trying to implement the following function but I would like to know what libraries I need to use in OpenGL because at the moment I have more than 100 errors. I am trying to implement 2 ...
0
votes
0answers
22 views

SFML Wont draw texture [on hold]

I am trying to load a texture from a different class but when I draw it the image draws white. But when I draw it from the main() it draw fine. Any idea on why this happens?
0
votes
0answers
53 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
10 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
0answers
9 views

Source SDK 2013. Binded key doesn't drop weapon. Please help! [on hold]

I'm having a problem with weapon drop system in my Source SDK 2013 Single Player Mod. I've followed this guide from VDC https://developer.valvesoftware.com/wiki/Adding_a_Weapon_Drop_System After ...
0
votes
0answers
18 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
64 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
22 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
30 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
76 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
34 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
82 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 ...
-5
votes
0answers
44 views

What to choose Game Engine or Make my own? [closed]

I want to go into game programing, I know basic stuffs in Unity, C++ / OpenGL, and I don't know what is better to make a Game Engine (I'm don't gone write a programing language for it, I will make ...
-4
votes
0answers
46 views

Noob question about programming, help [closed]

my name is Vitor Leal and I want to be a programmer, or better, a game developer. So I'm very confused because I don't know what programming language should I know first. Some people say to learn C++ ...
0
votes
3answers
72 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
0answers
33 views

How should I go about scripting voxel behavior?

I'm trying to add scripting to my voxel application. The scripts are meant to define blocks and their behaviors. However, this also means I must have unique data for each block since the script is ...
0
votes
1answer
94 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
32 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
43 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
20 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
1answer
35 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
48 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
45 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
108 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
50 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 ...
-1
votes
0answers
27 views

Protocol for stats transfers [closed]

My company is designing a poker style game. I have the work of designing the API and optimal network connections. What do you think is the most optimal protocol to be implemented for sending game ...
2
votes
1answer
53 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 ...
0
votes
1answer
46 views

How to send coordinates from one object to another [closed]

In the game I'm building, there is a class of coordinates x, y. There are other Creature objects that are located at different points along the Coordinate object. The Coordinate object is therefore ...
1
vote
1answer
37 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
21 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
54 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
795 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
50 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
225 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
51 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
60 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
33 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
56 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
53 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
60 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
30 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
50 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
41 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
75 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
41 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 ...