sdl

What is SDL_Surface? [closed]

老子叫甜甜 提交于 2019-12-13 08:19:40
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 years ago . I am following a tutorial by lazyfoo http://lazyfoo.net/tutorials/SDL/01_hello_SDL/index2.php and when drawing to the screen a 'surface is used. What is it, is it the similar to SDL_Texture? Is it to do with buffers? 回答1: This question is easily answered by looking at the documentation. SDL_Texture SDL_Texture

Undefined reference to sdl_function Android Studio

旧时模样 提交于 2019-12-13 07:57:26
问题 I am trying to run my sd l game on Android, I followed lazyfoo's tutorial to run the helloworld , which worked fine, later I imported my project, this project source works fine in windows without any error, but I am now seeing many errors in my files, I am new to android , I feel I have messed up with path's to my source files. below is the error: Android.mk (inside src dir): LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE := main SDL_PATH := ../SDL2 LOCAL_C_INCLUDES := $

Coord texture array does not works correctly with glDrawElements

陌路散爱 提交于 2019-12-13 06:10:04
问题 the purpose of my program is to load and display a simple cube with the same texture on each face. But the problem is that the output is not very good (just 4 faces are textured correctly).I tried lots of combinations of coordinates in the textures array but most of the time it's worse. Is it possible to set textures correctly with the function glDrawElements or not? #define OFFSET_BUFFER(bytes) ((GLfloat *)NULL + bytes) GLfloat vertices[] = { -1.0, -1.0, -1.0, 1.0, -1.0, -1.0, 1.0, 1.0, -1.0

C++ Multiple Definitions

倾然丶 夕夏残阳落幕 提交于 2019-12-13 06:07:43
问题 I'm trying to build these files but it's giving me a multiple definition error. main.cpp: #include "SDL/SDL.h" #include "Core.h" #include "GameStates.h" #include "globals.h" int main(int argc, char** args) { if(core.Initilization(640, 480, 32, SDL_SWSURFACE) == -1) { SDL_Quit(); } while(core.desiredstate != core.quit) { ::currentstate->EventHandling(); ::currentstate->Logic(); core.ChangeState(); ::currentstate->Render(); ::currentstate->Update(); } SDL_FreeSurface(core.screen); SDL_Quit(); }

C++ SDL, why does SDL_LoadBMP() return NULL?

拈花ヽ惹草 提交于 2019-12-13 06:06:09
问题 I've just started with SDL after doing some research. I started with this tutorial http://lazyfoo.net/SDL_tutorials/lesson01/index2.php << Using the exact same code and bmp image. For some reason when I debug and run the program inside my IDE (Microsoft visual studio) the screen loads but the picture that should be popping up on the screen does not. However, when I would go to my project and run the program manually it does everything smoothly. After doing some research it turned out SDL

SDL library in linux

亡梦爱人 提交于 2019-12-13 04:42:21
问题 I'm trying to compile this code: #include "SDL/SDL.h" int main(void) { SDL_Surface *Hello = NULL; SDL_Surface *Screen = NULL; SDL_Init( SDL_INIT_EVERYTHING ); return 0; } But it happens that the compiler says that: undefined reference to SDL_Init I dont know why this is happening. I'm using Debian Mint and Code::Blocks. Could you Help me? 回答1: It looks like you haven't got -lSDL on your link line. sdl-config returns the compile and link flags for your installation of SDL. Assuming the program

SDL 2.0 Build Error

旧街凉风 提交于 2019-12-13 04:39:37
问题 Apparently, I don't have SDL installed correctly since a sample program I found in some of the tutorials for SDL 2.0 don't buid correctly. Mind you, I am using Ubuntu 12.04 as my operating system, used the instructions in the source code of SDL 2.0.3 to install it on my OS, am using CodeLite 5.4, and am using C as my programming language. Here is the code I try to test: #include <SDL2/SDL.h> #include <stdio.h> int main(int argn,char **argv) { if(SDL_Init(SDL_INIT_VIDEO) != 0) { fprintf(stderr

How do i configure SDL to work with the Blackberry Playbook Native SDK / NDK?

南笙酒味 提交于 2019-12-13 04:25:35
问题 I've got the NDK set up and managed to compile and run the hello native sdk project on my playbook. I downloaded the blackberry sdl port from github. However I've been unable to compile even a hello world project using it. Also it seems to be lacking a "lib" folder which I'm used to needing for the compiler settings. EDIT: I have managed to get the sdl to open in the native sdk, it seems the download was designed to act as a project template of sorts. At first the compiler complained that i

PyInstalled Kivy App Fails to Run on Second Machine

落花浮王杯 提交于 2019-12-13 03:58:10
问题 I'm packaging a Kivy app using PyInstaller (3.4) for use on Windows machines. I've gotten it to compile and work on my machine but when moving the exe to another, it fails giving the error: [WARNING] [Image ] Unable to load image C:\Users\<OTHER_MACHINES_USER>\AppData\Local\Temp_MEI38442\kivy_install\data\glsl\default.png> [CRITICAL] [Window ] Unable to find any valuable Window provider. sdl2 - Exception: SDL2: Unable to load image This works from the dist folder when the whole thing is

Header file for SDL_Overlay

丶灬走出姿态 提交于 2019-12-13 02:59:44
问题 I plan to use both SDL_GetKeyboardState and SDL_Overlay but it seems there is a conflict. #include <stdio.h> #include <SDL/SDL.h> #include <SDL2/SDL.h> int main() { const Uint8 *keystate = SDL_GetKeyboardState(NULL); SDL_Overlay *bmp; printf("hello world!"); } Compile: gcc -c main.cpp When order of headers are: #include <SDL/SDL.h> #include <SDL2/SDL.h> error: ‘SDL_GetKeyboardState’ was not declared in this scope const Uint8 *keystate = SDL_GetKeyboardState(NULL); ^ or #include <SDL2/SDL.h>