上一页 1 ··· 34 35 36 37 38 39 40 41 42 ··· 48 下一页
摘要: LTexture.cpp void LTexture::render( GLfloat x, GLfloat y, LFRect* clip, LFRect* stretch, GLfloat degrees ){ if( mTextureID != 0 ) { glLoadIdentity(); 阅读全文
posted @ 2017-11-28 16:22 yongfengnice 阅读(191) 评论(0) 推荐(0)
摘要: LTexture.hvoid render( GLfloat x, GLfloat y, LFRect* clip = NULL, LFRect* stretch = NULL ); LTexture.cpp void LTexture::render( GLfloat x, GLfloat y, 阅读全文
posted @ 2017-11-28 16:02 yongfengnice 阅读(346) 评论(0) 推荐(0)
摘要: LTexture.h bool loadPixelsFromFile( std::string path );bool loadTextureFromFileWithColorKey( std::string path, GLubyte r, GLubyte g, GLubyte b, GLubyt 阅读全文
posted @ 2017-11-28 11:55 yongfengnice 阅读(170) 评论(0) 推荐(0)
摘要: LTexture.h bool lock(); bool unlock(); GLuint* getPixelData32();//获取像素 GLuint getPixel32( GLuint x, GLuint y );//获取x,y位置对应的像素点 void setPixel32( GLuint 阅读全文
posted @ 2017-11-24 18:20 yongfengnice 阅读(868) 评论(0) 推荐(0)
摘要: 纹理渲染的图片的宽度和高度需要是二次幂的,如果不是二次幂的,需要通过填充的方式(就是添加边距),填充到二次幂。 LTexture.h bool loadTextureFromPixels32( GLuint* pixels, GLuint imgWidth, GLuint imgHeight, GL 阅读全文
posted @ 2017-11-24 17:23 yongfengnice 阅读(762) 评论(0) 推荐(0)
摘要: LFRect.h//定义一个结构体,表示裁剪的区域 #ifndef LFRECT_H#define LFRECT_H #include "LOpenGL.h" struct LFRect{ GLfloat x;//x GLfloat y;//y GLfloat w;//宽 GLfloat h;//高 阅读全文
posted @ 2017-11-23 18:04 yongfengnice 阅读(2080) 评论(0) 推荐(0)
摘要: OpenGL本身没有文件操作有关的接口,需要使用第三方库。这里使用DevIL库。 下载连接:http://openil.sourceforge.net/download.php 下载DevIL-Windows-SDK,解压后在Visual Studio配置头文件位置、lib库位置、lib库名称,拷贝 阅读全文
posted @ 2017-11-23 17:16 yongfengnice 阅读(969) 评论(0) 推荐(0)
摘要: LOpengGL.h不变 LTexture.h #include "LOpenGL.h"#include <stdio.h> class LTexture{ public: LTexture(); ~LTexture(); bool loadTextureFromPixels32( GLuint* 阅读全文
posted @ 2017-11-23 15:49 yongfengnice 阅读(2741) 评论(3) 推荐(1)
摘要: LOpengGL.h头文件不变 LUtil.h GLfloat gCameraX = 0.f, gCameraY = 0.f;//相机位置 bool initGL(){ glViewport( 0.f, 0.f, SCREEN_WIDTH, SCREEN_HEIGHT ); glMatrixMode 阅读全文
posted @ 2017-11-22 17:55 yongfengnice 阅读(500) 评论(0) 推荐(0)
摘要: LOpengGL.h://不变 LUtil.h //添加枚举 enum ViewPortMode{ VIEWPORT_MODE_FULL, //全屏 VIEWPORT_MODE_HALF_CENTER, //中间 VIEWPORT_MODE_HALF_TOP,//中间上 VIEWPORT_MODE_ 阅读全文
posted @ 2017-11-21 18:08 yongfengnice 阅读(1093) 评论(0) 推荐(0)
上一页 1 ··· 34 35 36 37 38 39 40 41 42 ··· 48 下一页