91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 6.99MB
    文件類型: .rar
    金幣: 2
    下載: 0 次
    發布日期: 2023-11-02
  • 語言: 其他
  • 標簽: opengl??太陽系??

資源簡介

計算機圖形學,繪制一個宇宙的太陽系,要求有九大行星,有各自的公轉,自轉,以及月球繞地球等

資源截圖

代碼片段和文件信息

//?LoadTGA.c
//?Loads?a?Targa?file?for?OpenGL
//?Richard?S.?Wright?Jr.
//?OpenGL?SuperBible
//?This?really?only?works?with?24/32/8?bit?targas

#include?“Tool.h“
#include?

//?Define?targa?header.
#pragma?pack(1)
typedef?struct
????{
????GLbyte identsize;??????????????//?Size?of?ID?field?that?follows?header?(0)
????GLbyte colorMapType;???????????//?0?=?None?1?=?paletted
????GLbyte imageType;??????????????//?0?=?none?1?=?indexed?2?=?rgb?3?=?grey?+8=rle
????unsigned?short colorMapStart;??????????//?First?colour?map?entry
????unsigned?short colorMapLength;?????????//?Number?of?colors
????unsigned?char? colorMapBits;???//?bits?per?palette?entry
????unsigned?short xstart;?????????????????//?image?x?origin
????unsigned?short ystart;?????????????????//?image?y?origin
????unsigned?short width;??????????????????//?width?in?pixels
????unsigned?short height;?????????????????//?height?in?pixels
????GLbyte bits;???????????????????//?bits?per?pixel?(8?16?24?32)
????GLbyte descriptor;?????????????//?image?descriptor
????}?TGAHEADER;
#pragma?pack(8)



////////////////////////////////////////////////////////////////////
//?Allocate?memory?and?load?targa?bits.?Returns?pointer?to?new?buffer
//?height?and?width?of?texture?and?the?OpenGL?format?of?data.
//?Call?free()?on?buffer?when?finished!
//?This?only?works?on?pretty?vanilla?targas...?8?24?or?32?bit?color
//?only?no?palettes?no?RLE?encoding.
GLbyte?*gltLoadTGA(const?char?*szFileName?GLint?*iWidth?GLint?*iHeight?GLint?*iComponents?GLenum?*eFormat)
????{
????FILE?*pFile; //?File?pointer
????TGAHEADER?tgaHeader; //?TGA?file?header
????unsigned?long?lImageSize; //?Size?in?bytes?of?image
????short?sDepth; //?Pixel?depth;
????GLbyte *pBits?=?NULL;??????????//?Pointer?to?bits
????
????//?Default/Failed?values
????*iWidth?=?0;
????*iHeight?=?0;
????*eFormat?=?GL_BGR_EXT;
????*iComponents?=?GL_RGB8;
????
????//?Attempt?to?open?the?fil
????pFile?=?fopen(szFileName?“rb“);
????if(pFile?==?NULL)
????????return?NULL;
????????
????//?Read?in?header?(binary)
????fread(&tgaHeader?18/*?sizeof(TGAHEADER)*/?1?pFile);
????
????//?Do?byte?swap?for?big?vs?little?endian
#ifdef?__APPLE__
????BYTE_SWAP(tgaHeader.colorMapStart);
????BYTE_SWAP(tgaHeader.colorMapLength);
????BYTE_SWAP(tgaHeader.xstart);
????BYTE_SWAP(tgaHeader.ystart);
????BYTE_SWAP(tgaHeader.width);
????BYTE_SWAP(tgaHeader.height);
#endif


????//?Get?width?height?and?depth?of?texture
????*iWidth?=?tgaHeader.width;
????*iHeight?=?tgaHeader.height;
????sDepth?=?tgaHeader.bits?/?8;
????
????//?Put?some?validity?checks?here.?Very?simply?I?only?understand
????//?or?care?about?8?24?or?32?bit?targa‘s.
????if(tgaHeader.bits?!=?8?&&?tgaHeader.bits?!=?24?&&?tgaHeader.bits?!=?32)
????????return?NULL;

????//?Calculate?size?of?image?buffer
????lImageSize?=?tgaHeader.width?*?tgaHeader.height?*?sDepth;
????
????//?Allocate?memory?and?check?for?success
????pBits

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----

?????文件?????165376??2013-02-27?20:20??solar\Debug\glu32.dll

?????文件?????169984??2013-02-27?20:20??solar\Debug\glut.dll

?????文件?????169984??2013-02-27?20:20??solar\Debug\glut32.dll

?????文件???????3646??2013-05-06?18:53??solar\Debug\LoadTGA.obj

?????文件??????52981??2013-05-06?18:53??solar\Debug\LoadTGA.sbr

?????文件????3220480??2013-05-05?20:29??solar\Debug\Solar2.bsc

?????文件?????217168??2013-05-07?22:37??solar\Debug\Solar2.exe

?????文件?????272296??2013-05-07?22:37??solar\Debug\Solar2.ilk

?????文件??????27570??2013-05-07?22:37??solar\Debug\Solar2.obj

????I.A....???2423452??2013-05-06?19:30??solar\Debug\Solar2.pch

?????文件?????541696??2013-05-07?22:37??solar\Debug\Solar2.pdb

?????文件?????629631??2013-05-07?22:37??solar\Debug\Solar2.sbr

?????文件??????58368??2013-05-07?22:37??solar\Debug\vc60.idb

?????文件??????53248??2013-05-07?22:37??solar\Debug\vc60.pdb

?????文件????1572908??2013-05-05?20:28??solar\Earth.tga

?????文件?????302727??2013-05-05?20:24??solar\GLEXT.H

?????文件????3110444??2013-05-05?20:25??solar\Jupiter.tga

?????文件???????3780??2013-05-05?20:24??solar\LoadTGA.c

?????文件????3110444??2013-05-05?20:25??solar\Mars.tga

?????文件????1572908??2013-05-05?20:26??solar\Mercury.tga

?????文件????1572908??2013-05-05?20:28??solar\Moon.tga

?????文件?????777644??2013-05-05?20:24??solar\Neptune.tga

?????文件?????777644??2013-05-05?20:24??solar\Pluto.tga

?????文件?????777644??2013-05-05?20:24??solar\Saturn.tga

?????文件??????13188??2013-05-07?22:37??solar\Solar2.c

?????文件???????3583??2013-05-06?18:54??solar\Solar2.dsp

?????文件????????520??2013-05-05?20:24??solar\Solar2.dsw

?????文件?????107520??2013-05-07?22:37??solar\Solar2.ncb

?????文件??????48640??2013-05-07?22:37??solar\Solar2.opt

?????文件???????1218??2013-05-07?22:37??solar\Solar2.plg

............此處省略9個文件信息

評論

共有 條評論