sdl

libSDL, CMake and Mac OS X lion 2

馋奶兔 提交于 2019-12-12 01:09:12
问题 I'm trying to compile a cmake project on my mac, but it depends on the SDL. I have alreaday read "LibSDL, CMake and MacOSX Lion", however I couldn't solve this problem. CMakeList.txt cmake_minimum_required(VERSION 2.6.4 FATAL_ERROR) # Give a name to the project. project(movehead) # This include enable you to use our CMake framework find_package(qibuild) find_package(SDL REQUIRED) link_directories( /usr/local/lib ) link_libraries ( ${SDL_LIBRARY} SDLmain ) # Create an executable named movehead

Combining multiple .o files into an executable

女生的网名这么多〃 提交于 2019-12-12 00:13:03
问题 I'm trying to combine object files created from C++ files into an executable using gcc . Unfortunately, gcc is giving me thousands of undefined reference errors to strings, arrays, etc. I am doing this on a Windows machine, so no terminal commands; only cmd commands. I'm simply doing: gcc a.o b.o c.o -o prgm.exe What am I missing/doing wrong? EDIT: I recreated the .o files with g++ doing: g++ a.cpp -g -c -Wall -std=c++0x -lSDLmain -lSDL -lSDL_image -lSDL_ttf -IC:\SDL-1.2.14\include -o a.o ,

Problems with SDL_SetColorKey

时间秒杀一切 提交于 2019-12-11 23:41:55
问题 I'm trying to create a transparent sprite with SDL. I'm using SDL_SetColorKey on a bitmap with magenta (0xff00ff) background (it's 100% magenta, I checked it with the GIMP :)) The call to SDL_SetColorKey looks like this: SDL_SetColorKey( bitmap, SDL_SRCCOLORKEY, SDL_MapRGB(bitmap->format, 255, 0, 255) ); The call to SDL_SetColorKey apparently returns 0, however there is no transparency. Can anyone tell me what I am missing here? Here is the problematic code in case anyone wants to test it:

I've followed official guides to SDL on Android but its not making libmain.so

六月ゝ 毕业季﹏ 提交于 2019-12-11 23:13:08
问题 SDLActivity calls loadLibrary("main") but it's just libSDL2.so there. I struggled getting this far and have almost no experience of Android.mk , despite having built native android applications with cocos2d-x. Is it Android.mk I must investigate to create this library? I've got DinoMage's jni/src/main.c in place and have a stub extending SDLActivity under my package name. Sorry for no code, there's lots, everywhere, only it's location and Android.mk could differ from DinoMage's guide, which

SDL draw PNG image from raw image data string

扶醉桌前 提交于 2019-12-11 17:46:07
问题 I've setup a PNG resource file in my SDL2 project for Windows 32bit in C++. HRSRC hRes = FindResource(0, MAKEINTRESOURCE(IMGID), "PNG"); if (!hRes) { Log::Error("Find resource IMGID"); return; } HGLOBAL hData = LoadResource(0, hRes); if (!hData) { Log::Error("Load resource IMGID"); return; } DWORD dataSize = SizeofResource(0, hRes); char* data = (char*)LockResource(hData); std::string result; result.assign(data, dataSize); The result variable contains all the characters of the PNG image (if

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

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

HarfBuzz - hb_shape() leads to access violation

瘦欲@ 提交于 2019-12-11 13:23:44
问题 Based on this example, I try to implement font rendering in my SDL application. When calling hb_shape() , the application is halted because of an access-violation. DLL-download-link (win32): here {harfbuzz-0.9.26-win32.zip} ErrorMsg (VC2012): Unhandled exception at 0x6160B7F0 (libharfbuzz-0.dll)in ConsoleApplication2.exe: 0xC0000005: Access violation while reading at position 0x00000068 EDIT: I changed the example to a console application, for simplicity. Edit2: Now linking statically, .lib

SDL_GL_SwapWindow bad performance

徘徊边缘 提交于 2019-12-11 11:45:38
问题 I did some performance testing and came up with this: glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); for(U32 i=0;i<objectList.length();++i) { PC d("draw"); VoxelObject& obj = *objectList[i]; glBindVertexArray(obj.vao); tmpM = usedView->projection * usedView->transform * obj.transform; glUniformMatrix4fv(shader.modelViewMatrixLoc, 1, GL_FALSE, tmpM.data()); //glActiveTexture(GL_TEXTURE0); glBindTexture(GL_TEXTURE_2D, typesheet.tbo); glUniform1i(shader.typesheetLoc, 0); glDrawArrays(GL

Android Studio - Space in user name causing crashes, NDK is not installed to this directory

无人久伴 提交于 2019-12-11 11:10:30
问题 I am trying to develop an android application with SDL and have been following this tutorial. http://lazyfoo.net/tutorials/SDL/52_hello_mobile/android_windows/index.php I followed this tutorial on my laptop earlier and actually completed the tutorial successfully until my laptop stopped working due to a battery issue. I decided to just do the whole tutorial again on my main pc. This was going great until I reach part 15 in the tutorial. After following this tutorial's advice successfully I

SDL2 Blit Scaled from a palettized (8bpp) Surface gives error: Blit combination not supported

孤者浪人 提交于 2019-12-11 10:56:35
问题 I'm using 8bpp surfaces for a NES emulator so it's convenient to do simple palette swaps instead of having to fiddle with the pixel data. But Blitting Scaled from an 8bpp Surface gives the error Blit combination not supported regardless if the destination is 8bpp or 32bpp. Any suggestion to make it work? 回答1: Of course the solution was Blitting from 8bpp to 32bpp and then doing BlitScaled between 32bpp surfaces. 来源: https://stackoverflow.com/questions/33850453/sdl2-blit-scaled-from-a