| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 677 人关注过本帖
标题:关于OpenGL的一个载入纹理的前提函数
只看楼主 加入收藏
壮志在我胸
Rank: 3Rank: 3
来 自:邯郸
等 级:论坛游侠
威 望:1
帖 子:158
专家分:125
注 册:2009-9-7
结帖率:75%
收藏
 问题点数:0 回复次数:1 
关于OpenGL的一个载入纹理的前提函数
Public Function LoadGLTextures() As Boolean
'Load up desired bitmaps and convert them into textures
'that can be used by OpenGL

Dim sFile As String
Dim bmFile As BITMAPFILEHEADER
Dim bmInfo As BITMAPINFOHEADER
Dim bmRGB() As RGBQUAD
Dim iFile As Integer
Dim lImageSize As Long
Dim iPixelSize As Integer
Dim baImageData() As Byte

  On Error GoTo ERR_H

  'Set the filename
  sFile = App.Path & "\" & TEXTURE_FILE
  
  iFile = FreeFile
  
  Open sFile For Binary As iFile
  
  'Read in the headers
  Get #iFile, , bmFile
  Get #iFile, , bmInfo
  
  'Determine how many colors are used
  If (bmInfo.biBitCount < 24) Then
    'Less than 24 bits per pixel are used, so allocate space for the color table
    ReDim bmRGB(bmInfo.biClrUsed)
   
    'Read in the color table
    Get #iFile, , bmRGB
  End If
  
  'Determine how big the image is
  iPixelSize = bmInfo.biBitCount / 8
  
  lImageSize = bmInfo.biWidth * bmInfo.biHeight * iPixelSize
  
  ReDim baImageData(lImageSize)
  
  'Read in the image data
  Get #iFile, , baImageData
  
  Close #iFile
谁会啊,解释下
搜索更多相关主题的帖子: 纹理 OpenGL 函数 前提 载入 
2010-05-14 17:11
bczgvip
Rank: 14Rank: 14Rank: 14Rank: 14
等 级:贵宾
威 望:66
帖 子:1310
专家分:5312
注 册:2009-2-26
收藏
得分:0 

问题呢?
2010-05-14 22:10
快速回复:关于OpenGL的一个载入纹理的前提函数
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.018541 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved