sdl

Change current working directory VS13?

强颜欢笑 提交于 2019-12-11 02:55:03
问题 As stated in this post the working directory when I debug my SDL program is relative to the .vcproj instead of the .exe (which it should be IMO) So I'm wondering if there's anyway I can change this, so when i press F5 the path will be relative to the .exe and not .vcproj? The current (relatively easy) workaround I'm using, is simply opening up the folder and starting program from there, but I would much rather prefer simply pressing F5. 回答1: The naive answer to your question is that you can

Error in Pygame “Hello World” program Mac OS 10.8

萝らか妹 提交于 2019-12-11 02:21:26
问题 I am running Pygame in Mountain Lion. I think it is all installed correctly as I can import the module without any errors. When I try and run a very simple program I get an exception. Here is the code: import pygame, sys from pygame.locals import * pygame.init() DISPLAYSURF = pygame.display.set_mode((400, 300)) pygame.display.set_caption("Hello World!") while True: for event in pygame.event.get(): if event.type == QUIT: pygame.quit() sys.exit() pygame.display.update() Here is the exception:

SDL OpenGL Rendering Issue

╄→гoц情女王★ 提交于 2019-12-11 02:13:51
问题 I am just learning how to use SDL and openGL. I've been through the tutorials over at SDLTutorials.com. I am now trying to take things further and create a loading screen for an application; an oop menu system. I am starting off real simple to test things out. I have the main backdrop of the window done via a texture class. The two relevant functions are defined here: void Texture::Bind() { glBindTexture(GL_TEXTURE_2D, TextureID); } void Texture::RenderQuad(int X, int Y, int Width, int Height

SDL_PollEvent seems to prevent window surface from updating

霸气de小男生 提交于 2019-12-11 00:30:44
问题 I'm currently walking through the Lazy Foo tutorials for SDL2 (I'm doing this on a Linux machine) and I'm encountering some kind of bug where the inclusion of SDL_PollEvent in my main loop seems to prevent SDL_UpdateWindowSurface from actually updating. If I leave the SDL_PollEvent loop out, the loaded bmp displays properly. However, if I include the SDL_PollEvent loop or even a call to SDL_PollEvent , then the window never gets updated with an image. Everything else seems to work fine, SDL

linker command failed, sdl

放肆的年华 提交于 2019-12-11 00:17:18
问题 I'm trying to compile my very first SDL program, but it doesn't compile.By the way, this shouldn't be about setting up the library I guess because I think that I installed the library properly. This is my command : g++ main.cpp -o main -I/Library/Frameworks/SDL2.framework/Headers -framework SDL2 This is my code : #include <iostream> #include <SDL.h> int main(int argc, char **argv){ if (SDL_Init(SDL_INIT_EVERYTHING) != 0){ std::cout << "SDL_Init Error: " << SDL_GetError() << std::endl; return

Playing sine soundwave with SDL2 - noise / scratch issue

末鹿安然 提交于 2019-12-10 23:49:30
问题 My goal is to create an SDL window plotting different waveforms and playing an indefinite sound of this wave. By pressing specific keys, the parameters of the wave, like the amplitude, frequency or waveform can be modified. The problem is that even a simple sine wave which looks nice when plotted, sounds noisy. I don't understand why. Code: #include "Graph.h" #include <thread> #include <iostream> #include <sstream> #include <string> int main(int argc, char* argv[]){ Graph* g = new Graph();

C++ SDL “Native' has exited with code -1073741701 (0xc000007b)”

情到浓时终转凉″ 提交于 2019-12-10 22:29:22
问题 My Code #include "SDL.h" #include <iostream> #undef main int main ( void ) { SDL_Init( SDL_INIT_EVERYTHING ); SDL_Quit( ); return 0; } I followed LazyFoo's tut, but I still needed to modify my settings even to build the solution. Now, every time I debug it I get this: The program [11228] xxx.exe: Native' has exited with code -1073741701 (0xc000007b). Can you help me please ? edit: I'm running Windows 7 64bit, and I've the x86 lib package included, linker inputs: SDL.lib;SDLmain.lib;SDL_image

C++ game loop example

一笑奈何 提交于 2019-12-10 19:51:11
问题 Can someone write up a source for a program that just has a "game loop", which just keeps looping until you press Esc, and the program shows a basic image. Heres the source I have right now but I have to use SDL_Delay(2000); to keep the program alive for 2 seconds, during which the program is frozen. #include "SDL.h" int main(int argc, char* args[]) { SDL_Surface* hello = NULL; SDL_Surface* screen = NULL; SDL_Init(SDL_INIT_EVERYTHING); screen = SDL_SetVideoMode(640, 480, 32, SDL_SWSURFACE);

OpenGL: always same color

喜你入骨 提交于 2019-12-10 18:51:17
问题 I'm writting a program on windows using c++ , opengl 2.1 and SDL and am having some issues with the vertex colors. I'm using glColor3f to set the color for each vertex set, but it seems to not be working. I get every vertex drawn red no matter what color I pick. I checked the values being passed to glColor3f and they are indeed not 1.f,0.f,0.f... Has anyone ever encountered such a problem, or knows what might be causing it? Am I maybe not including some lib I should? Or do you reckon it might

How do I set window titlebar icon and alt-tab icon in SDL2 / C++ / Visual Studio 2012 express program?

不羁岁月 提交于 2019-12-10 17:36:55
问题 I have added a .rc file to my project with just the following: IDI_MAIN_ICON ICON "..\\..\\icon_artwork\\windows_icons\\project.ico" The .ico file contains icons at 16x16, 32x32, 48x48 and 256x256 resolutions. I see the icon in the taskbar and explorer (so there is no doubt the .ico is successfully embedded in the .exe), but I see the default Windows 7 application icon in the application's own title bar, and in alt-tab. Is there a way to get the OS to see the embedded icon by itself in all