上一页 1 ··· 34 35 36 37 38 39 40 41 42 ··· 49 下一页
摘要: LTexture.cpp void LTexture::render( GLfloat x, GLfloat y, LFRect* clip ){ if( mTextureID != 0 ) { GLfloat texTop = 0.f; GLfloat texBottom = (GLfloat)m 阅读全文
posted @ 2017-11-28 17:57 yongfengnice 阅读(252) 评论(0) 推荐(0)
摘要: 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 阅读(192) 评论(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 阅读(348) 评论(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 阅读(172) 评论(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 阅读(873) 评论(0) 推荐(0)
摘要: 纹理渲染的图片的宽度和高度需要是二次幂的,如果不是二次幂的,需要通过填充的方式(就是添加边距),填充到二次幂。 LTexture.h bool loadTextureFromPixels32( GLuint* pixels, GLuint imgWidth, GLuint imgHeight, GL 阅读全文
posted @ 2017-11-24 17:23 yongfengnice 阅读(767) 评论(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 阅读(2084) 评论(0) 推荐(0)
摘要: OpenGL本身没有文件操作有关的接口,需要使用第三方库。这里使用DevIL库。 下载连接:http://openil.sourceforge.net/download.php 下载DevIL-Windows-SDK,解压后在Visual Studio配置头文件位置、lib库位置、lib库名称,拷贝 阅读全文
posted @ 2017-11-23 17:16 yongfengnice 阅读(971) 评论(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 阅读(2743) 评论(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)
上一页 1 ··· 34 35 36 37 38 39 40 41 42 ··· 49 下一页