11 2017 档案
摘要:LTexture.cpp void LTexture::render( GLfloat x, GLfloat y, LFRect* clip ){ if( mTextureID != 0 ) { GLfloat texTop = 0.f; GLfloat texBottom = (GLfloat)m
阅读全文
摘要:LTexture.cpp void LTexture::render( GLfloat x, GLfloat y, LFRect* clip, LFRect* stretch, GLfloat degrees ){ if( mTextureID != 0 ) { glLoadIdentity();
阅读全文
摘要:LTexture.hvoid render( GLfloat x, GLfloat y, LFRect* clip = NULL, LFRect* stretch = NULL ); LTexture.cpp void LTexture::render( GLfloat x, GLfloat y,
阅读全文
摘要:LTexture.h bool loadPixelsFromFile( std::string path );bool loadTextureFromFileWithColorKey( std::string path, GLubyte r, GLubyte g, GLubyte b, GLubyt
阅读全文
摘要:LTexture.h bool lock(); bool unlock(); GLuint* getPixelData32();//获取像素 GLuint getPixel32( GLuint x, GLuint y );//获取x,y位置对应的像素点 void setPixel32( GLuint
阅读全文
摘要:纹理渲染的图片的宽度和高度需要是二次幂的,如果不是二次幂的,需要通过填充的方式(就是添加边距),填充到二次幂。 LTexture.h bool loadTextureFromPixels32( GLuint* pixels, GLuint imgWidth, GLuint imgHeight, GL
阅读全文
摘要:LFRect.h//定义一个结构体,表示裁剪的区域 #ifndef LFRECT_H#define LFRECT_H #include "LOpenGL.h" struct LFRect{ GLfloat x;//x GLfloat y;//y GLfloat w;//宽 GLfloat h;//高
阅读全文
摘要:OpenGL本身没有文件操作有关的接口,需要使用第三方库。这里使用DevIL库。 下载连接:http://openil.sourceforge.net/download.php 下载DevIL-Windows-SDK,解压后在Visual Studio配置头文件位置、lib库位置、lib库名称,拷贝
阅读全文
摘要:LOpengGL.h不变 LTexture.h #include "LOpenGL.h"#include <stdio.h> class LTexture{ public: LTexture(); ~LTexture(); bool loadTextureFromPixels32( GLuint*
阅读全文
摘要:LOpengGL.h头文件不变 LUtil.h GLfloat gCameraX = 0.f, gCameraY = 0.f;//相机位置 bool initGL(){ glViewport( 0.f, 0.f, SCREEN_WIDTH, SCREEN_HEIGHT ); glMatrixMode
阅读全文
摘要:LOpengGL.h://不变 LUtil.h //添加枚举 enum ViewPortMode{ VIEWPORT_MODE_FULL, //全屏 VIEWPORT_MODE_HALF_CENTER, //中间 VIEWPORT_MODE_HALF_TOP,//中间上 VIEWPORT_MODE_
阅读全文
摘要:LOpengGL.h://和前一节一样。 LUtil.h://添加 const int COLOR_MODE_CYAN = 0;//定义两个颜色选择const int COLOR_MODE_MULTI = 1; void handleKeys( unsigned char key, int x, i
阅读全文
摘要://通过正则匹配出关键字,然后使用span使之变色高亮private SpannableString getHighLightSs(String text, String keyword, int color) { SpannableString span = new SpannableString
阅读全文
摘要:LOpengGL.h://导入头文件,注意:先导入freeglut.h #include <GL/freeglut.h>#include <GL/gl.h>#include <GL/glu.h>#include <stdio.h> LUtil.h: #include "MyOpenGL.h"#inc
阅读全文
摘要:OpenGL本身并不提供GUI操作,不过有很多开源的库提供了支持。在学习OpenGL时,我选择window上的freeGLUT库作为辅助,用于GUI操作。下面说一下Visual Studio下的OpenGL和freeGLUT环境的搭建。 1. 下载freeGLUT 下载链接:http://freeg
阅读全文
摘要:在Android Studio 的External Tools添加javap命令,方便一键生成方法签名,便于开发。 添加步骤: 1. 打开Android Studio,File——>Settings——>Tools——>External Tools,如图: 如上图,先点击1,然后点击2的加号。(上面
阅读全文
摘要:1 .前言 由于在使用SDL2开发的过程,需要加载png图片,而SDL2本身不提供加载png图片的功能实现。所以需要在引入SDL2_image库。 如果想查看Android Studio下怎么编译SDL2库,请查看 http://www.cnblogs.com/yongfengnice/p/7827
阅读全文
摘要:1. 确保引入appcompat和design库,比如: compile 'com.android.support:appcompat-v7:23.0.0' compile 'com.android.support:design:23.0.0' 2. 在app的build.gradle下添加l如下代
阅读全文
摘要:1. 下载并解压SDL源代码 下载链接:https://libsdl.org/download-2.0.php 2. 导入项目 2-1.导入项目, 如图: 2-2. 找到下载好的SDL源代码,选择android-project,点击OK,如图 2-3. 选择一个空目录,作为导入的Android工程目
阅读全文
摘要:1. 命令 nm -D,如下所示: nm -D liblistdevs.so > listdevs.txt //列出 liblistdevs.so 的函数 输出到 listdevs.txt 文本文件里面 2. 命令 objdump -tT,如下所示: objdump -tT liblistdevs.
阅读全文
摘要:1. Android.mk文件 以及 Application.mk文件 的作用 Android.mk 文件是用来配置 jni编译的 源文件输入、编译参数、编译输出产物 等等。 Application.mk 文件是用来 指定平台有关的配置信息,比如编译的平台版本、平台架构、使用的标准库 等等 2. A
阅读全文
摘要:错误现象: $ adb install app-debug.apk 提示:Failed to install app-debug.apk: Failure [INSTALL_FAILED_TEST_ONLY: installPackageLI] 解决方法一,加 -t : $ adb install
阅读全文
摘要:1. 下载开发工具 下载CMake、LLDB、Android NDK,如图所示(勾选表示已经下载了,没勾选就勾选并点击右下角的apply进行下载,减号表示下载不完整或者有更新,再点击就可以勾选然后apply去下载或更新): CMake是编译器,类似于GCC、Clang等等。LLDB是用于调试的,类似
阅读全文
摘要:1. 打开cmd窗口,cd进入分卷文件目录下 比如:我下载的分卷文件在Downloads文件夹下,就cd到Downloads文件夹下 分别为:macOS10.12.7z.001、 macOS10.12.7z.002、 macOS10.12.7z.003、 macOS10.12.7z.004、 mac
阅读全文
摘要:1. 下载source insight 4 下载地址:https://www.sourceinsight.com/updates/ 2.下载破解文件 下载地址:http://download.csdn.net/download/yongfengnice/10102990 3.安装完后,找到安装目录
阅读全文
摘要:Jetbrain的CLion是一款c,cpp的付费ide,智能提示不错。 下载地址:https://www.jetbrains.com/clion/ 安装完成后,激活时选择License server,接着输入http://idea.imsxm.com/ 点击Active(激活)即可。 暂时不知道能
阅读全文