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

learn more… | top users | synonyms

0
votes
0answers
28 views

OpenGL shaders with OOP languages and game engines [on hold]

Is it okay to encapsulate all the dirty shaders codes inside a class object, and then let the user call easy methods such as Render()? I've done this with a simple Skybox object and I wonder if this ...
0
votes
1answer
63 views

Ray->triangle collision math seems to not work?

First time asking, pardon any mistakes I make :) I am programming a game from scratch, and the collision detection is giving me issues. I have AABB in place to check proximity, and if that reacts, ...
0
votes
0answers
46 views

Alternative to a timer in a separate thread in a turn-based game

I'm making a 2d turn based game and I'm having some difficulties with the timer itself. 3 characters vs 3 characters, two players. A timer giving them a chance to preform acts within a set amount of ...
-2
votes
0answers
65 views

RAII and modern C++ in game dev [on hold]

Are the use of the RAII idiom and of the modern C++ principles adapted to game development in general ? Automatic memory management on the stack Smart pointers References Or, can these features ...
0
votes
0answers
41 views

Updating sprite Rect each frame

I have made a struct which sets 4 variables that define a rect void setDestSize(int width, int height) { Width = width; Height = height; } void ...
-1
votes
0answers
44 views

How do I extract 3d data from the Maya c++ API correctly [on hold]

My model doesn't show up in my Direct3D 11 application with animation. So, either I am loading the model incorrectly, or I am extracting the data from Maya incorrectly. I know the mesh data is ...
0
votes
0answers
21 views

How to convert OpenCV camera capture to Irrlicht texture without killing fps?

I am looking to include images captured from the users webcam into my application so I've been looking into using OpenCV to capture from the webcam and then render it in Irrlicht. I've created a basic ...
0
votes
0answers
28 views

Frustum Culling not working when objects are transformed

I've been implementing some frustum culling and my code looks like this. // Frustum Culling XMVECTOR detView = XMMatrixDeterminant(cam->View()); XMMATRIX invView = XMMatrixInverse(&detView, ...
-2
votes
0answers
97 views

game breaks on nvidia hardware [closed]

I have been developing my game using directx 10 SDK june version with c++ in an AMD ATI laptop I tested my game on intel CPU with integrated graphics 4600 and it works fine but then I tested it in ...
0
votes
1answer
62 views

Instancing effectiviness

At about how many instances would instancing become effective? DirectX dynamic buffers seem to take a little more out of the fps than an immutable one would. So obviously you wouldn't want to make a ...
0
votes
0answers
34 views

Setting up local players in Unreal Engine

I'm trying to make a 4 player 2D local multiplayer game. I have tried a lot of stuff to get to this stage, but as far as I have been told, a method called CreateLocalPlayer creates a local player, ...
0
votes
0answers
67 views

*.3ds format support [closed]

Does the *.3ds format support: texture animation and light? What is the best game engine to use with the lib3ds? (I want a low level game engine) (its for lerning) Thank you a lot for answering my ...
0
votes
1answer
45 views

Textures not rendering on part of Cube [closed]

Hello all I have been trying learning opengl and have rendered a colorful cube and decided to texture it, now when I run the program the textures render on all of the faces except for the back face ...
0
votes
0answers
53 views

SFML - Rendering a torch with a fire animation [duplicate]

I have coded a 3D maze simulator in SFML using raycasting. However, I want to add a torch to the screen, so that the lighting seems more realistic. From my understanding, I would have to use ...
0
votes
0answers
38 views

'Bad' triangles when doing affine texture mapping

I am really clueless about what i must do. I wrote a function to do affine texture mapping, but i get in most situations 'bad' triangles. I really didn't want to ask this question as it probably is ...
0
votes
1answer
43 views

DirectX 8.0 SDK

I know this in unprofessional and probably doesn't follow the question asking conventions on this site, but I cannot find any other, more suitable (in my opinion) network on stackexchange to ask this ...
0
votes
1answer
40 views

What are .fxo and .cod files for?

I've been reading about shaders and looking at code. I found this in the code I'm looking at and it obviously has "Basic.fxo" there. BasicFX = new BasicEffect(device, L"FX/Basic.fxo"); Now my ...
2
votes
2answers
97 views

Destroying object from object method

My game uses an entity manager and entities to represent everything including the player, enemes, items, ..everything in the game. In my engine it's the responsibility of every entity to update ...
1
vote
1answer
31 views

Handle vertex indicies in a vbo batch drawing call

I'm new in the OpenGL 2 world and want to render a lot of cubes (> 150.000). How can I render such kind of cubes in practise? My idea is to split the cubes to a set of vbo's (Maybe 2000 cubes per ...
2
votes
1answer
40 views

Box2D Issues determining the side of collision

I'm trying to determine which side of my object a collision is happening. In all of my searching, I have found 2 different proposed solutions, but each one has a major issue. I'm hoping that someone ...
0
votes
0answers
38 views

C++ - SFML - OpenGL - GLSL - smooth waving texture

I have this shaders: Fragment: uniform float time; uniform sampler2D texture; void main() { float t = time; vec2 aux = gl_TexCoord[0].xy; // This would also make waving/deform the ...
1
vote
1answer
88 views

D3D11/C++ Inaccuracies in uv interpolation in pixel shader. How to avoid?

I'm trying to draw a quad with a texture onto the screen such that texels and pixels perfectly align. Sounds pretty easy. I draw 2 triangles (as TRIANGLE_LIST, so 6 vertices) using these shaders: ...
0
votes
1answer
73 views

DirectX Rendering to a texture

I'm trying to implement a rendering to a texture but without success. I've created a class that will(should) take care about all these stuff: class TextureRenderer { public: TextureRenderer() = ...
2
votes
1answer
135 views

How would you implement a simple strategy player controller in Unreal Engine 4?

All player controllers in the C++ game templates are not for strategy games. They all implemented so the player controls just one character. I'm not sure what approach to take when you want to control ...
0
votes
2answers
117 views

Why it’s recommended to keep global variable initialization and the objects’ constructors very simple (C++)? [closed]

Considering game-development? I have this question in a gamedev quiz and I wonder what to answer. Any clues?
0
votes
0answers
62 views

OpenGL - Arcball camera rotation

I'm implementing arcball camera rotation, whereby a camera is looking at a coordinate and rotates around it in the x-axis or the y-axis such that the camera is circulating around it; the y-axis will ...
1
vote
2answers
283 views

C++, OpenGL: Building a polyhedron via geometry shader

I'm stuck with geometry shaders in OpenGL - c++ programming. I want to create simple cube by repeating 6 times drawing one rotated wall. Here is my vertex shader (everyting has #version 330 core in ...
0
votes
1answer
46 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 ...
0
votes
0answers
42 views

Calculate hit-normal from collision

I am trying to implement a swept test collision between an AABB and a Line Segment and I found this implementation working great ... Except that it doesn't cover how to calculate the hitNormal and ...
3
votes
1answer
172 views

Is it more efficient to transform vertices on the CPU or the GPU?

Working on optimizing the rendering core of my game engine and I have a couple of questions. Is it more efficient to transform vertices to world space on the CPU before you send then stream to the ...
0
votes
1answer
64 views

OpenGL Viewport inside of a Viewport

I'm creating a labyrinth in opengl, and I'm trying to create a minimap. For that, I thought of creating a viewport inside of a viewport. I already tried following a tutorial from Lazy Foo, and I can ...
8
votes
1answer
622 views

Taking advantage of multithreading between game loop and openGL

Talking in context of a game based on openGL renderer : Let's assume there are two threads : Updates the game logic and physics etc. for the in game objects Makes openGL draw calls for each game ...
1
vote
1answer
48 views

Reference keyboard keys as “justPressed”, “pressed”, and “justReleased” with SDL in C++

I'm teaching myself 3D graphics with OpenGL and SDL in C++. I'm at a point where I need to be able to query states of individual keys, like so: if (InputManager::justPressed(SDLK_UP)) {} if ...
2
votes
1answer
64 views

Alternatives to map of strings in regard to performance

I would like to start my first question here with a subjective question. I think it qualifies as constructive. To introduce the situation: I have a 2D tiled map. I also had different arrays of ...
3
votes
3answers
153 views

C++ friend class, rendererer and mesh

I often hesitate to use friend classes in C++. Since it often does not feel right, or just seems to be an indicator of bad design. Though, in this case I think a friend class might improve the design. ...
0
votes
2answers
130 views

Can someone explain to me how setting shader parameters aren't a bottleneck?

I am trying to understand this. So I have a bunch of models that need to be rendered. Each model most likely has various "sub meshes" with their own diffuse, specular, etc textures. So for each of ...
0
votes
0answers
23 views

Eclipse OpenGL include problems

I have eclipse and the c++ plugin. C/C++ compiles but for some reason it's including the right stuff except the glut.h. glut.h is in the miniGW folder in include/GL, but it's not finding it some how. ...
0
votes
1answer
50 views

glVertexAttribPointer stride ambiguity

As a hobbyist junior game programmer, I have done multiple small OpenGL projects just to have fun with 3D. I've tested VBOs in C++ and in Java and I found something or rather understood Java tutorials ...
1
vote
0answers
5 views

How do you add libraries to CMakeLists? [migrated]

After searching everywhere I could not find anything or anyone to help me figure out how to add GL GLEW and SDL2 Libraries to my CMakeLists.txt. I am using Ubuntu 14.04 LTS and I installed the ...
-1
votes
0answers
26 views

Moving from point A to B optimalisation [duplicate]

Here's my abstract class for movement: vector2d normalize(vector2d v) { auto a = sqrt(dotProduct(v, v)); vector2d r; r.x = v.x/a; r.y = v.y/a; return r; } ...
0
votes
0answers
33 views

Playing Multiple Sound effects isssue in cocos2d-x

Please help if someone faced this issue. I have a sound effect 3sec long which need to be played repeatedly for some time of 10 to 15 secs. Implemented like below: ...
0
votes
2answers
41 views

How can I chain together Stencil tests from the same re-occurring routine, but keep the tests separate?

Sorry for the bad title; I don't know how else to explain this. I have a class called a Container. An instance of Container has other elements "inside" it. These elements have independent positions ...
0
votes
0answers
64 views

Need Help with Cocos2d Ver 3.3 AudioEngine

So I have 2 audio files that I want to play at different times: background.wav a sneeze.wav. I believe that I have to convert both wav files into mp3, caf and ogg files. Then I do this: static ...
0
votes
2answers
145 views

Collision Direction Detection

I'm making an RPG game where players and enemies can collide with walls. Right now it pushes the player off the wall when he tries to 'go through' it. However, I detect which way he should be pushed ...
1
vote
0answers
33 views

Blending Lightmaps and Dynamic Texture Shadows in HLSL

I'm using Gile[s] as my lightmapper and my engine can execute HLSL scripts with DirectX 9. I would like to accomplish something like this for performance reasons. I was told that this technique can ...
0
votes
1answer
72 views

Trying to implement Camera

I'm trying to implement a Camera class in order to walk and look on the world as follow: #ifndef _CAMERA_H_ #define _CAMERA_H_ #include <glm\glm.hpp> class Camera { public: Camera(); ...
1
vote
1answer
83 views

Handling creation of entities on level creation

I'm currently working on a 2d physics based plat former, kinda in the style of super meat boy. In super meat boy, you have multiple levels and I want a similar sort of thing but is there a general way ...
4
votes
1answer
228 views

Game Programming Gems series still of value? [closed]

Former Nintendo dev Mark DeLoura wrote a series of books called "Game Programming Gems". (http://www.satori.org/game-programming-gems/) Do these books still contain valuable concepts, considering ...
0
votes
1answer
42 views

differences betwen game resolution in a different display resolution

my game is not supported on the other devices with a different resolutions. for example may character is 140w X 55h pixels which is ok on a 4 inch display but it goes wide when i tested my game on a ...
0
votes
0answers
81 views

Directx9 engine Z-buffer problem with d3dimage

I am trying to integrate my Direct9 engine into my new WPF application via D3DImage. Everything is working except for the Z buffer. With the AutoDepthStencil at FALSE I can render my meshes but the ...