sdl

How can I use ARGB color in opengl/SDL?

岁酱吖の 提交于 2019-12-01 05:20:49
I am rendering SVG using Cairo. The Cairo output format is ARGB. Then I put rendered image in a SDL_Surface so I can use it as a openGL texture. The rendered image was looking just fine when I use directly the SDL_Surface. But I had to use the surface as a texture in openGL because I needed some openGL function. The problem is, that all the color are flipped. OpenGL use RGBA and not ARGB. I was wondering if anybody could help me converting a SDL_Surface ARGB to RGBA. Usefull information: I used this tutorial to render my SVG. http://tuxpaint.org/presentations/sdl_svg_svgopen2009_kendrick.pdf

How can I use ARGB color in opengl/SDL?

北城以北 提交于 2019-12-01 05:01:33
问题 I am rendering SVG using Cairo. The Cairo output format is ARGB. Then I put rendered image in a SDL_Surface so I can use it as a openGL texture. The rendered image was looking just fine when I use directly the SDL_Surface. But I had to use the surface as a texture in openGL because I needed some openGL function. The problem is, that all the color are flipped. OpenGL use RGBA and not ARGB. I was wondering if anybody could help me converting a SDL_Surface ARGB to RGBA. Usefull information: I

Using SDL_ttf and OpenGL, TTF_RenderUTF8_Blended print Red rectangle

流过昼夜 提交于 2019-12-01 04:42:58
问题 When I render my text using TTF_RenderUTF8_Blended I obtain a solid rectangle on the screen. The color depends on the one I choose, in my case the rectangle is red. My question What am I missing? It seems like I'm not getting the proper Alpha values from the surface generated with SDL_DisplayFormatAlpha(TTF_RenderUTF8_Blended( ... )) , or am I? Does anyone recognize or know the problem? Additionnal informations If I use TTF_RenderUTF8_Solid or TTF_RenderUTF8_Shaded the text is drawn properly,

SDL.dll is missing from my computer - VS 2010

天涯浪子 提交于 2019-12-01 04:31:18
I'm trying to compile a SDL-program I've written, but when I do, this error shows up: The program can't start because SDL.dll is missing from your computer. Try reinstalling the program to fix this problem I have no idea as to why. I have SDL.dll. I have put it in the correct folder: C:\Windows\System32 . I have the correct PATHS to all the SDL headers and such as well. VS says: Build succeeded: 1 and THEN the error above pops up on screen. Add it into your debug folder or whatever directory your program is currently located at. SDL.dll has to either be in the same directory as your

SDL_GL_SwapBuffers() is intermittently slow

╄→гoц情女王★ 提交于 2019-12-01 04:25:13
I have a sdl/opengl game I am working on for fun. I get a decent fps on average, but movement is really choppy because SDL_GL_SwapBuffers() will randomly take a crazy long amount of time to process. With textures loaded and written to the buffer sometimes it will take over 100ms! I cut out a lot of my code to try and figure out if it was something I did wrong but I haven't had much luck. When I run this bare bones program it will still block for up to 70ms at times. Main: // Don't forget to link to opengl32, glu32, SDL_image.lib // includes #include <stdio.h> // SDL #include <cstdlib> #include

Couple of questions about SDL_Window and unique_ptr

ⅰ亾dé卋堺 提交于 2019-12-01 04:05:18
问题 I currently had a problem with storing a SDL_Window pointer as a std::unique_ptr. What I tried was: std::unique_ptr<SDL_Window> window_; The solution: std::unique_ptr<SDL_Window, void(*)(SDL_Window*)> window_; The first attempt kept throwing errors in the memory header, saying SDL_Window is an incomplete type. Well I know that SDL_Window is a struct and can't be instanciated with SDL_Window* window_ = new SDL_Window(); therefore the instanciation is done with SDL_CreateWindow(params).

pyGame within a pyGTK application

给你一囗甜甜゛ 提交于 2019-12-01 03:29:38
What is the best way to use PyGame (SDL) within a PyGTK application? I'm searching for a method that allows me to have a drawing area in the GTK window and at the same time being able to manage both GTK and SDL events. I've never attempted it myself, but hearing plenty about other people who've tried, it's not a road you want to go down. There is the alternative of putting the gui in pygame itself. There are plenty of gui toolkits built specifically for pygame that you could use. Most of them are rather unfinished, but there are 2 big, actively maintained ones: PGU and OcempGUI . The full list

SDL_GL_SwapBuffers() is intermittently slow

隐身守侯 提交于 2019-12-01 02:41:28
问题 I have a sdl/opengl game I am working on for fun. I get a decent fps on average, but movement is really choppy because SDL_GL_SwapBuffers() will randomly take a crazy long amount of time to process. With textures loaded and written to the buffer sometimes it will take over 100ms! I cut out a lot of my code to try and figure out if it was something I did wrong but I haven't had much luck. When I run this bare bones program it will still block for up to 70ms at times. Main: // Don't forget to

Ubuntu 11.10: GCC/G++ won't link libraries

戏子无情 提交于 2019-12-01 01:32:33
问题 I went to compile a project of mine, which uses SDL, SDL_ttf, OpenAL, and GTK. All of which are outputting errors like the following: TxtFunc.cpp:(.text+0x61): undefined reference to `TTF_OpenFont' TxtFunc.cpp:(.text+0x8c): undefined reference to `TTF_RenderText_Solid' TxtFunc.cpp:(.text+0xf6): undefined reference to `SDL_UpperBlit' TxtFunc.cpp:(.text+0x108): undefined reference to `TTF_CloseFont' TxtFunc.cpp:(.text+0x114): undefined reference to `SDL_FreeSurface' for every library call. I am

Compiling SDL on a MAC

若如初见. 提交于 2019-12-01 01:30:07
#include "ffmpeg/libavcodec/avcodec.h" #include "ffmpeg/libavformat/avformat.h" #include "ffmpeg/libswscale/swscale.h" #include "ffmpeg/libswscale/rgb2rgb.h" #include "ffmpeg/libswscale/swscale_internal.h" #include <stdio.h> #ifdef __MINGW32__ #undef main /* Prevents SDL from overriding main() */ #endif #include "SDL.framework/Headers/SDL.h" #include "SDL.framework/Headers/SDL_thread.h" Is Compiled with this command: gcc -o t1 tutorial01.c -lswscale -lavutil -lavformat -lavcodec -lz -lavutil -lm -framework SDL But I get this error: Undefined symbols: "_main", referenced from: start in crt1.10