sdl

Unable to link to SDL2 functions using MinGW

痴心易碎 提交于 2019-12-30 05:57:11
问题 I'm relatively new to programming and I've decided to give SDL a try, but I'm a bit stuck. I haven't been able to build the project in codeblocks and I get 'undefined reference' to all SDL functions. I've seen a lot of similar questions here, but none of the solutions seems to help. I've already added the \include\SDL2 and the \lib folders to search directories, I've added SDL2Main and SDL2 to link libraries in linker options, I've even added -mwindows to other linker options. Also, I tried

Current state and solutions for OpenGL over Windows Remote

谁说胖子不能爱 提交于 2019-12-30 04:49:05
问题 OpenGL and Windows Remote don't play along nicely. Solutions for this are dependent on the use case and answers are fragmented across the vast depths of the net. This is a write-up I wish existed when I started researching this, both for coders and non-coders. Problem: A RDP session of Windows does not expose the graphics card, at least not directly. For instance you cannot change the desktop resolution and GraphicsCard drivers usually just disable their setting menus. Starting a OpenGL

Simple sound wave generator with SDL in c++

好久不见. 提交于 2019-12-30 02:13:25
问题 i am having problems understanding how the audio part of the sdl library works now, i know that when you initialize it, you have to specify the frequency and a >>callback<< function, which i think is then called automatically at the given frequency. can anyone who worked with the sdl library write a simple example that would use sdl_audio to generate a 440 hz square wave (since it is the simplest waveform) at a sampling frequency of 44000 hz? 回答1: The Introduction to SDL has got a neat

Linux/X11 input library without creating a window

假如想象 提交于 2019-12-29 06:55:13
问题 Is there a good library to use for gathering user input in Linux from the mouse/keyboard/joystick that doesn't force you to create a visible window to do so? SDL lets you get user input in a reasonable way, but seems to force you to create a window, which is troublesome if you have abstracted control so the control machine doesn't have to be the same as the render machine. However, if the control and render machines are the same, this results in an ugly little SDL window on top of your

Other's library #define naming conflict

余生长醉 提交于 2019-12-28 23:57:32
问题 Hard to come up with a proper title for this problem. Anyway... I'm currently working on a GUI for my games in SDL. I've finished the software drawing and was on my way to start on the OpenGL part of it when a weird error came up. I included the "SDL/SDL_opengl.h" header and compile. It throws "error C2039: 'DrawTextW' : is not a member of 'GameLib::FontHandler'", which is a simple enough error, but I don't have anything called DrawTextW, only FontHandler::DrawText. I search for DrawTextW and

How to output to the console in C++/Windows

岁酱吖の 提交于 2019-12-28 04:08:08
问题 When using iostream in C++ on Linux, it displays the program output in the terminal, but in Windows, it just saves the output to a stdout.txt file. How can I, in Windows, make the output appear in the console? 回答1: Since you mentioned stdout.txt I google'd it to see what exactly would create a stdout.txt; normally, even with a Windows app, console output goes to the allocated console, or nowhere if one is not allocated. So, assuming you are using SDL (which is the only thing that brought up

SDL视频渲染教程

。_饼干妹妹 提交于 2019-12-27 17:22:54
#include <SDL2/SDL.h> int main() { SDL_Window *window=NULL; SDL_Renderer *render=NULL; SDL_Texture *texture=NULL; SDL_Event event; SDL_Rect rect; int quit=0; //初始化环境 SDL_Init(0); //创建一个窗口 window = SDL_CreateWindow("test",200,200,900,600,SDL_WINDOW_SHOWN); if(!window) { } //创建一个渲染器 render = SDL_CreateRenderer(window,-1,0); if(!render) { } /* //设置背景色 SDL_SetRenderDrawColor(render,255,0,0,30); //SDL_RenderDrawLine(render,300,300,600,600); SDL_RenderClear(render); SDL_RenderPresent(render); // SDL_Delay(5000); //event.window */ /* 视频渲染流程: 将一幅图像的rgb数据 经过抽象为一个纹理数据 然后发送数据至显卡,然后显卡根据纹理还原一幅图像数据

SDL环境初始化测试代码

女生的网名这么多〃 提交于 2019-12-26 02:06:59
#include <SDL2/SDL.h> int main() { SDL_Window *window=NULL; SDL_Renderer *render=NULL; //初始化环境 SDL_Init(0); //创建一个窗口 window = SDL_CreateWindow("test",200,200,900,600,SDL_WINDOW_SHOWN|SDL_WINDOW_BORDERLESS); if(!window) { } //创建一个渲染器 render = SDL_CreateRenderer(window,-1,0); if(!render) { } //设置背景色 SDL_SetRenderDrawColor(render,255,0,0,30); SDL_RenderDrawLine(render,300,300,600,600); SDL_RenderClear(render); SDL_RenderPresent(render); SDL_Delay(5000); //删除渲染器 SDL_DestroyRenderer(render); //删除窗口 SDL_DestroyWindow(window); //卸载环境 SDL_Quit(); return 0; } 来源: CSDN 作者: Car12 链接: https://blog.csdn

OpenGL white blank screen and not responding

一曲冷凌霜 提交于 2019-12-25 09:34:54
问题 I am using SDL2.00 with OpenGL to create a program. The program isn't supposed to do anything at the moment it's just a test bed. However I ran into a problem. When I create a window using SDL_CreateWindow, the window goes into a busy state and stops responding. The program flow isn't really affected by this however the window itself just won't work. All it does is show a white blank window and accept no input, can't resize can't move and can't quit. I will attach the code but I doubt it is

SDL strange linker error in MVS

浪子不回头ぞ 提交于 2019-12-25 05:24:07
问题 I'm stumped trying to link the SDL libraries against a new C++ Win32 Console application in MVS 2010. I downloaded the latest SDL development libraries, and did the usual steps: Added the includes to the include path (pic) [This works fine, as MVS finds the #include files] Added the library path for SDL (pic) [This seems to work fine, as removing this additional path gives the error "error LNK1104: cannot open file 'SDL.lib'"] Added SDL.lib and SDLmain.lib to the linker additional