sdl

SDL2_ttf won't run on ios

拜拜、爱过 提交于 2019-12-13 02:09:18
问题 So case is - i downloaded latest SDL2_ttf library, opened XCode-IOS project, included in package, built it without any problem and connected to my project. Everything compiled and ran, but at start my program quits with message in output: apinames 0.1: extract FreeType API names from header files this program is used to extract the list of public FreeType API functions. It receives the list of header files as argument and generates a sorted list of unique identifiers usage: apinames header1

Convert double to string quickly observing given precision

a 夏天 提交于 2019-12-13 01:12:26
问题 I have a C++ program using SDL . During rendering, I need to draw some graphics components. I sometimes need to convert double variables, rounded to one decimal, to std::string . For this, I'm currently using a ostringstream object and it works fine. std::ostringstream ss; ss << std::fixed << std::setprecision(1) << x; However, I'm wondering if this way of converting variables is a good idea with regards to performance. I've tried to round the double variables with std::to_string(std::round(x

SDL Linker error on mingw/msys: ld.exe cannot find -lSDL

北城余情 提交于 2019-12-13 00:42:29
问题 Problem is actually that my compiler doesn't find the SDL library files. I rounded down possible errors by removing all SDL files, reinstalling SDL and compiling without SDL_image. No help. Files I copied from SDL-devel-1.2.15-mingw32.tar.gz package: sdl\include to mingw\include\sdl (I later copied files to mingw\include root as well) sdl\lib to mingw\lib (3 files: libSDL.dll.a libSDLmain.a and libSDL.la) sdl.dll and sdl-config to mingw\bin I installed it via msys, and later manually just to

SDL program freezes

谁都会走 提交于 2019-12-13 00:05:05
问题 I'm writing a simple program for testing mouse. It compiles fine, but doesn't work. When I launch it, the window freezes. What am I doing wrong? #include <SDL/SDL.h> #undef main int main() { if (SDL_Init (SDL_INIT_EVERYTHING) != 0) return 1; SDL_Surface* Scr; if ((Scr = SDL_SetVideoMode (300, 200, 32, 0)) == 0) return 2; SDL_Rect Mouse1 = {50, 50, 50, 100}; SDL_Rect Mouse3 = {150, 50, 50, 100}; SDL_Rect Mouse2 = {250, 50, 50, 100}; SDL_Surface Colors; SDL_Rect Click = {0, 0, 50, 100}; SDL

Can't Close Window

筅森魡賤 提交于 2019-12-12 22:42:39
问题 I'm following the Lazy Foo tutorial on C++ and SDL2. I'm trying to learn it using regular C and noticed something interesting when following instructions on adding events to detect a close window event. Here is the code. #include <stdio.h> #include <stdbool.h> #include "SDL2/SDL.h" bool init(); bool loadMedia(); void close(); const int SCREEN_WIDTH = 640; const int SCREEN_HEIGHT = 480; SDL_Window *gWindow = NULL; SDL_Surface *gScreenSurface = NULL; SDL_Surface *gHelloWorld = NULL; int main

宜信SDL实践:产品经理如何驱动产品安全建设

大城市里の小女人 提交于 2019-12-12 18:44:30
一、序言 本文从产品经理的角度出发,对产品经理的安全职责、产品驱动安全的内涵、工作内容、工作方法、所需安全资源、以及产品经理的安全工作量进行了分析。希望所有产品经理在没有心理负担的情况下,有目标、有方法、有资源推进产品安全建设。 二、背景 安全是软件产品天然属性的一部分,“无安全不金融”,对于金融软件产品而言,安全尤为重要,因为客户总是能够从各种安全漏洞联想到他的金融资产安全和个人信息安全。以前偶尔会在一些安全沙龙或峰会听见同行吐槽,“信息安全说起来重要、做起来次要、忙起来不要”。吐槽背后的原因很复杂,其中很重要的一点是跟产品经理安全意识淡薄、不清楚如何推进产品安全建设有关,比如不重视产品安全属性、产品安全需求不明确、产品安全资源不充分、产品安全建设无从下手等。本文主要站在产品经理的角度,从产品经理能力维度出发,探讨产品经理如何推动产品的安全性建设。 众所周知,安全性作为软件产品的天然属性,从产品定义与规划角度来看,产品经理对产品安全负有不可推卸的责任,但产品经理如何履行自己的安全职责,业界还没有给出一个清晰可行的行动方案。 目前,软件产品安全需求通常是基于开发人员和安全人员的职业常识提出相应的解决方案,比如目前业内比较通用的敏感信息五要素分析方法: 这种方法简单易行,但往往不能涵盖所有的敏感信息,比如 用户的多系统用户数据关联ID(超级ID)。 交易过程中的音视频等多媒体数据。

How do I make a static library Release/Debug independent in VS2010 Express?

一个人想着一个人 提交于 2019-12-12 17:29:48
问题 I am programming an application and linking against SDL and OpenGL. In my code I have the following lines: #pragma comment(lib, "sdl.lib") #pragma comment(lib, "sdlmain.lib") #pragma comment(lib, "opengl.lib") This works in Release mode only. In Debug mode, I receive the following linker error: libcmt.lib(invarg.obj) : error LNK2005: __initp_misc_invarg already defined in LIBCMTD.lib(invarg.obj) libcmt.lib(invarg.obj) : error LNK2005: __call_reportfault already defined in LIBCMTD.lib(invarg

failed: dlopen failed: cannot locate symbol “signal” referenced by “libSDL2.so”

寵の児 提交于 2019-12-12 15:39:29
问题 building an Android application using the SDL, I am loading this in the java file using System.loadLibrary("SDL2");but when I try to run the application on an android tablet, it gives the following error "java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol “signal” referenced by “libSDL2.so”…" 回答1: Make sure your ndk platform version matches your phone's architecture. I had to experiment with a few different ndk versions to figure it out myself. If that fails, perhaps you are

'GL_CLAMP_TO_EDGE' was not declared in this scope

﹥>﹥吖頭↗ 提交于 2019-12-12 12:32:31
问题 How do I fix this? I've got both gl/gl.h, and gl/glu.h included, so what gives? 回答1: "It''s part of OpenGL 1.2, which is why it isn''t in Microsoft''s OpenGL 1.1 header. Add this line to your code somewhere. BTW, you should probably check the GL version at runtime before using it. #define GL_CLAMP_TO_EDGE 0x812F " I just googled it and found this. Does it help? 来源: https://stackoverflow.com/questions/5617250/gl-clamp-to-edge-was-not-declared-in-this-scope

Prevent SDL program from consuming extra resources

戏子无情 提交于 2019-12-12 10:43:00
问题 I'm designing program that should demonstrate open CV on images. I've noticed very bad concept of basic SDL application - it consists of loop and delay. while(true) { while(event_is_in_buffer(event)) { process_event(event); } do_some_other_stuff(); do_some_delay(100); //Program is stuck here, unable to respond to user input } This makes the program execute and render even if it is on background (or if re-rendering is not necessary in the first place). If I use longer delay, I get less