All Questions

Tagged with
Filter by
Sorted by
Tagged with
21 votes
6 answers
3k views

Consistent cross platform procedural generation

What techniques have people successfully used or can suggest to deal with a consistent cross platform math for procedural world generation? Also, if you have done this, what were the pros and cons of ...
  • 448
1 vote
1 answer
151 views

Can't create Render Target with CreateDxgiSurfaceRenderTarget

I'm trying to create ID2D1RenderTarget to be used for writing text with DirectWrite. I tried two methods but can't get it working, both yield "The parameter is incorrect" error code. In the ...
0 votes
0 answers
55 views

Best way to save screenshots in a game?

I'm making a game, and I'm adding a screenshots feature. Currently I save screenshot files to <Home Directory>/Pictures/MyGame/. However, I'm not sure if ...
user avatar
0 votes
1 answer
112 views

Are there any serious advantages for C++ compared to C? [closed]

so I know a little bit about C (read like a few university level textbooks on it, I am not an experienced programmer or anything) and now I would like to learn the ropes of the Unreal engine to fidle ...
  • 101
0 votes
1 answer
889 views

Creating a game on Linux with SDL and distributing it

TL, DR: Will I be able to get a single .exe file which will work smooth in a PC which does not have SDL or so installed ever. If not, how close will be the closest ...
  • 101
0 votes
0 answers
163 views

Cyclone LED gaming code HOW TO HELP?

I am very new to programming. For a project I decided to make a game of cyclone using some LEDs,a push button, and a raspberry pi. I researched how to at least start on the game, but the problem that ...
1 vote
0 answers
214 views

Doom-style 8 directions sprite math HELP C++ [duplicate]

I'm trying to get Doom-style 8 direction sprite rotation that changes its sprite depending on the camera and the forward vector of the entity just like this video here: https://www.youtube.com/watch?v=...
1 vote
2 answers
284 views

Is it possible to make desktop visible behind drawn object using SDL2?

I would like to draw an avatar over the desktop, something similar to those word 97 assistants, my idea so far is to make only the background transparent but I haven't had any luck, any suggestion? is ...
  • 11
3 votes
1 answer
3k views

How do I check if a window has focus in SDL2?

Is there a replacement for SDL_GetAppState function in SDL2 from older SDL versions? Why was it removed? I want to use it so I can check if the user has focused the ...
  • 529
2 votes
1 answer
13k views

Why am I getting these errors when including stb_image.h? [closed]

I'm trying to put an include guard around including stb_image.h (from the well-known public domain image library). I have noticed that, unusually, the include ...
2 votes
1 answer
816 views

How to handle Japanese on Windows and Linux using SDL_ttf and C++?

In SDL_ttf, there are a few functions provided that handles non-ASCII string literals, such as: TTF_RenderUNICODE_Solid ...
6 votes
1 answer
6k views

Handling variable frame rate in SDL2

i am creating a game with C++ and SDL2 game engine but i noticed this. I used the Vsync option for rendering, so it'll render at 60fps. If i use this game with another monitor, fps are different (for ...
2 votes
2 answers
453 views

Mixing DirectX headers with C mod project not working

I'm trying to add a DirectX 11 renderer (not sure if that is even doable in a "simple" manner) to the Return To Castle Wolfenstein source code and I'm having some problems. I have a rendering class in ...
  • 507
1 vote
1 answer
306 views

How do I detect collision between an ellipse and a rhombus?

I'm building a game in C/C++ (been alternating between the two), but one of the biggest problems I've run into is collision detection. The game is isometric and exists on a 2x1 grid (e.g. the base ...
1 vote
1 answer
827 views

SDL 2.0 OpenGL not drawing anything except background

My 'hello triangle' compiles well, no errors, but doesn't drawing anything. Here's my code: main.cpp ...
  • 111
1 vote
0 answers
191 views

Linux: blit image on screen without stuttering at a stable frame rate

I'm working on a very simple game, and one of the project goals is to minimise the use of libraries. I'm drawing every frame into a buffer, which is then displayed using ...
1 vote
6 answers
295 views

C/C++ Flexible yet fast way of linking UI elements to functions

I am currently working on the UI functionality of my game, which will have very minimal GUI design, yet it needs to be functional and flexible e.g. easy to redesign. I am planning to construct all my ...
  • 145
5 votes
1 answer
8k views

Key released, multiple Keys, how to go around ncurses limitations?

I have been trying to make a small game in the terminal in C++ using ncurses. After searching around for some time, I came to realize that ncurses is pretty limiting as far as keyboard inputs are ...
  • 1,057
0 votes
1 answer
482 views

glUniformMatrix4dv with a unidimensional array

I am trying to convert this C++ gml code to C and am getting the same array but I cannot see anything on the screen, is there something I am doing wrong maybe on the shader? GML code in C++: ...
  • 113
1 vote
1 answer
2k views

SDL_RenderPresent is writing over the previous frame

Whenever I call SDL_RenderPresent, the previous frame is replaced with black before the new frame is displayed. It's almost like when I call ...
  • 149
2 votes
1 answer
2k views

Is it possible to use C++ in SDL for Android?

I have successfully compiled SDL for Android using the example, which uses C. Is it possible to use C++ too? I am trying to port a C++ game which uses SDL 2 to Android. If it is possible, how can I ...
  • 155
3 votes
2 answers
4k views

How to pass PNG image data directly to SDL?

Well passing just external PNG to SDL is very easy with the SDL_image library. I have a class that does just that. The code looks like the following: ...
  • 133
2 votes
3 answers
3k views

What is the lowest-level way of making graphics from scratch?

I am currently trying to get into game development and trying to understand 3D games. I would like to learn to code from scratch without any 3D engines. Some of the things I found was libraries like ...
1 vote
1 answer
1k views

OpenGL dynamic font glyph cache library

I have begun work on an OpenGL application (all on my own and with little knowledge) and started with FTGL, rendering true type fonts, which, with alot of text has a great impact on frames per second. ...
  • 63
-2 votes
1 answer
211 views

how is c useful in game development [closed]

I know that C++ is the king in game development especially in the AAA market can anyone tell my how is C helpful I am a Computer Science student in my first year and are they any aspects of C i have ...
1 vote
0 answers
387 views

SDL2 SDL_CreateTexture returns pointer to existing texture

I have an initialized renderer in SDL2 that works fine. I create some textures from images using SDL_CreateTextureFromSurface and store them in a vector. ...
  • 111
0 votes
1 answer
47 views

traversing the area

i want to move point along spiral like hexagon for example i want to traverse the whole area and my player (point) is standing where i have placed it manually. now i want to start from this point and ...
0 votes
1 answer
103 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
2 answers
1k views

Registering a C++ callback with Lua API without additional libraries

Basically, I'm trying to register a callback into a Lua state like this: ...
  • 11
1 vote
2 answers
165 views

Overload how an object instance of a class is treated when used

So I've made this struct that encapsulates a glm::vec4. This is because vec3s are treated as 16-byte in GLSL, but I don't want ...
2 votes
1 answer
817 views

C++ Ray Traversing in 3D Voxel game

I'm currently working on a Voxel game in 3D and need a tad bit of help to figure out what Voxel the player is looking at. This is the data I currently have: ...
1 vote
1 answer
76 views

How can I send matrix data to shaders without the Effects11 framework?

I'm making a Direct3D engine but I'm stuck with this one little problem. I want to not use effect files but instead use shader files. What can I use to send matrix variables to shaders if I don't use ...
5 votes
2 answers
5k views

How to detect graphics API at runtime with SDL2?

Using SDL2, is there a way to determine at runtime whether the application is using OpenGL, OpenGLES, or DirectX? EDIT: If there is a way to figure it out without using the SDL2 API, I'm willing to ...
2 votes
1 answer
2k views

Emscripten code and three.js

I would like, if it's possible, to use Emscripten code generated from C/C++ with the Javascript library three.js. For example, from emscripten code I want to pass rendering information to the three.js ...
  • 31
0 votes
2 answers
12k views

Which library to choose between SDL and GTK for C game Development (Begginer) [closed]

I've been programming in C it's been some time, now I want to get into game development but I'm not sure which GUI library should I use between SDL or GTK? Is it worth sticking up with C or should I ...
0 votes
2 answers
343 views

Is networking programming quite generic

I have only looked into the basics, at least I assume it gets more complex. So does network code really change from one game to the next or is it pretty much portable. For example I can create say a 2 ...
0 votes
1 answer
73 views

Problem with .hdr/.pic format

So, everything was clear from the specification point of view, but when I moved to reading through some of the original implementations and reimplementations, I ran into this: ...
  • 15
1 vote
1 answer
266 views

When creating the horizontal blur, how is the vertex shader being called for each pixel?

I am following this tutorial. I am confused as to why the VertexShader is being called each time for the PixelShader. I was under the assumption the VertexShader is called only 6 times during the ...
1 vote
1 answer
4k views

Set Sampler states: Linear, Bilinear, Trilinear Filtering/Interpolation

How do you set each of these sampler states in the hlsl Linear filtering Bilinear filtering Trilinear filtering
0 votes
1 answer
2k views

Can you use python, c and c++ in udk without plugins?

Im pretty new to game engines and i was wondering if I could use python, c and c++ in udk. I've tried getting the answer all over the internet but the answers i do find aren't very clear. So am i ...
  • 137
1 vote
0 answers
626 views

GLX/X11 Changing the rendering resolution

I have made a simple application that creates a window with an OpenGL 4.2 context and takes user input. I have implemented making the window go fullscreen with XRandR and can change the display ...
2 votes
1 answer
2k views

does glBindAttribLocation silently ignore names not found in a shader?

Does glBindAttribLocation silently ignore names that are not found? For example, in a shader: ...
  • 123
1 vote
1 answer
916 views

Score system for "little bit more complex" snake game

I have created snake game. I can't think of good score system so that is is fair. There is only one highscore list for all modes. Player can choose any size of board - Let's call that param "Board ...
  • 113
0 votes
3 answers
529 views

Would it be inefficient to call LWJGL from C++?

I like LWJGL, but Java? Not so much. I recently found out a way to call Java methods from C++. But would this be inefficient? I mean, calling a C/C++ DLL from Java, just to be called back again into C+...
  • 1,361
11 votes
3 answers
5k views

Is GNU GCC used for AAA games?

GNU GCC is a very common compiler, but it seems like almost no one uses it for bigger projects like AAA games. To me, it's works just fine, never had a problem with it. But I wonder why all AAA games ...
  • 1,361
1 vote
2 answers
3k views

Exclusive mouse movement with WM_INPUT

Microsoft seems to recommend using WM_INPUT for input. I want to only get relative mouse input and hide the mouse cursor all together for a short while (For gesture ...
  • 841
2 votes
3 answers
12k views

What compilers are used in game development? [closed]

I was kinda wondering what compilers are used in game development, since the game development industry always tries to squeeze every inch of performance out their software, using, among other, (...
0 votes
2 answers
2k views

Is there an alternative to SDL 1.3 for a C++ game that should run on iOS and Android? [closed]

I've used SDL for many desktop games, always as the cross-platform glue for: Creating a window Processing input Rendering images Rendering fonts Playing sounds/music It has never disappointed me at ...
  • 1,457
3 votes
5 answers
698 views

Is It More Efficient To Make Games In Languages I Like?

Is it more "efficient" to develop games with languages you're good with and like best rather then the "best" language? For example: I like C# (It's My First Language) and I'm really good at it and ...
-3 votes
1 answer
539 views

Why are game engines written in C++? [duplicate]

Possible Duplicate: Why has the industry switched from C to C++? Since many organizations have demonstarated Object orientation in C and we all know its ABI compatibility that C++ lacks, why game ...