sdl

Android Studio, NDK - Cannot Run Application

强颜欢笑 提交于 2020-01-07 04:44:13
问题 I have managed to (finally) build a test SDL2 app with Android Studio & NDK using the Gradle experimental plugin. When I try to run the project, it won't run. I get the following error: :app:compileDebugSources :app:transformClassesAndResourcesWithExtractJarsForDebug UP-TO-DATE :app:transformClassesWithDexForDebug UP-TO-DATE :app:processDebugJavaRes UP-TO-DATE :app:transformResourcesWithMergeJavaResForDebug UP-TO-DATE :app:validateDebugSigning :app:packageDebug FAILED FAILURE: Build failed

Conway's Game of Life: cell changes being calculated incorrectly after changing neighbour count function

南笙酒味 提交于 2020-01-06 15:32:34
问题 Wondering if someone could help me work out this little issue. I've written a function to count the living neighbours of a cell in Conway's Game of Life: int countLivingNeighbours(int a[][GRID_WIDTH], int x, int y){ int count = 0, cx, cy; for(cy = y - 1; cy <= y + 1; cy++){ for(cx = x - 1; cx <= x + 1; cx++){ if(a[cy][cx] == ALIVE){ count++; } } } // subtract 1 so it's not counting it's own cell count--; return count; } It takes a 2-dimensional array of all cells as an argument, along with

Custom blocking function in C++

这一生的挚爱 提交于 2020-01-06 07:37:52
问题 I'm creating application model with three threads based on while(true) and a blocking function. Event thread - waits for user input, blocked by SDL_WaitEvent Socked thread - waits for data from server, blocked by blocking socket. Render thread - renders data from buffer, not blocked. I have a problem with rendering thread - i need a blocking function that will, for example, block until some paint event (defined by me and dispatched in one of other two threads) happens. But I don't know how

Build SDL mixer for Android

牧云@^-^@ 提交于 2020-01-05 09:12:04
问题 I have already build SDL for Android. But, unfortunately, SDL_mixer is missing there. So I want to build SDL mixer. Problem is: SDL_mixer wants SDL, so how I can include libsdl.so and SDL includes to my eclipse SDL_mixer project? 回答1: In Android.mk for SDL_mixer, there is a reference to SDL library: LOCAL_SHARED_LIBRARIES = SDL2 So, if you build the two libraries together , the reference will be fulfilled automatically. Alternatively, you can define SDL2 as PREBUILT_SHARED_LIBRARY. 来源: https:

Why won't CG shaders work with GL 3.2?

大兔子大兔子 提交于 2020-01-05 07:45:07
问题 I've tried everything to get OpenGL 3.2 to render with CG shaders in my game engine but I have had no luck. So I decided to make a bare minimal project but still shaders won't work. In theory my test project should just render a red triangle but it is white because the shader is not doing anything. I'll post the code here: #include <stdio.h> #include <stdlib.h> #include <vector> #include <string> #include <GL/glew.h> #include <Cg/cg.h> #include <Cg/cgGL.h> #include <SDL2/SDL.h> int main() {

The application was unable to start correctly (0xc000007b) error when working with SDL2 C++

情到浓时终转凉″ 提交于 2020-01-05 06:04:24
问题 Ok so here's the problem. Recently I got interested in C++ game programming and I was working with SDL2 libraries. Everything worked fine up until I wanted to load SDL2 Image libraries. The first problem I encountered was that the first setup I was working with x64 libraries but there were some issues with running the code so I changed it to x86. I changed the Linker -> Additional Library Directories from x64 to x86, Platform from x64 to All platforms as well as Executable Directories and

Embedding WebKit in C++ Application

南楼画角 提交于 2020-01-05 04:57:07
问题 I'm writing a game in C++ using the SDL framework, and want to create my game's GUI using HTML/CSS. I've looked into frameworks such as Awesomium, however I'm turned off by the fact that it's not open source. I want to create my own implementation of a similar idea. However, I can find almost no documentation on actually using WebKit in this manner. The closest I can find is this Apple Developer guide to using WebKit but it's targeted at MacOS-specific applications written in Objective-C. It

Get SDL or SDL2 working correctly with Dev-C++

为君一笑 提交于 2020-01-05 04:32:07
问题 I'm really new to programming in C++ and I've seen some tutorials of this programming language. I'm using Dev-C++ 5.11. So I wanted to make a game seeing a tutorial on YouTube, and a step was to set up SDL2 correctly. So I started searching on Google and tried a few things that some pages explained. But it kept showing up errors. Here's the last tutorial I tried with: The compiler log (It's a bit messy): C:\Program Files (x86)\Dev-Cpp\MinGW64\x86_64-w64-mingw32\bin\ld.exe skipping

SDL 2.0 source has 1.3 in it?

*爱你&永不变心* 提交于 2020-01-03 13:51:50
问题 I'm playing around with the SDL 2.0 source code and noticed it has another SDL folder within it that claims to be version 1.3. I'm interested in it because it has source for android, iphone and a few others. The stable version , 1.2, seems to be quite different. My question is this, SDL wiki link This link speaks of SDL_compat.c which may allow code to work for both 1.2 and 2.0. Is this the version I should be using, and should I be coding they way the 2.0 API suggest? I want my code to

SDL_image visual glitch on OS X El Capitan

一世执手 提交于 2020-01-03 06:39:14
问题 When trying to load and display bitmaps using Allegro 5 in C or PyGame in Python (both use SDL), instead, it renders a glitch (see screenshot below). I tried googling it and found that it could be related to SDL_image incompatibilities with OS X El Capitan, but no solutions. Anyone? Currently, I tried: Installing SDL_image 1.2.10 (latest compatible release). Nope! Installing SDL_image 1.2.10 with Homebrew via a custom formula. Also nothing! On the screenshot, those random pixels should be