• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>

            (轉(zhuǎn))glut函數(shù)詳解(1)--glut初始化API

            *轉(zhuǎn)自:http://old.blog.edu.cn/user3/zjdukang/archives/2007/1751751.shtml
            (1)    void glutInit(int *argc, char **argv);
                 這個函數(shù)用來初始化GLUT庫.這個函數(shù)從main函數(shù)獲取其兩個參數(shù).對應(yīng)main函數(shù)的形式應(yīng)是:int main(int argc,char* argv[]);
            //*******************************************************************************************
            (2)    void glutInitDisplayMode(unsigned int mode);
            設(shè)置圖形顯示模式.參數(shù)mode的可選值為:
                 GLUT_RGBA:當(dāng)未指明GLUT—RGBA或GLUT—INDEX時,是默認(rèn)使用的模式.表明欲建立RGBA模式的窗口.
                 GLUT_RGB:與GLUT—RGBA作用相同.
                 GLUT_INDEX:指明為顏色索引模式.
                 GLUT_SINGLE:只使用單緩存
                 GLUT_DOUBLE:使用雙緩存.以避免把計算機作圖的過程都表現(xiàn)出來,或者為了平滑地實現(xiàn)動畫.
                 GLUT_ACCUM:讓窗口使用累加的緩存.
                 GLUT_ALPHA:讓顏色緩沖區(qū)使用alpha組件.
                 GLUT_DEPTH:使用深度緩存.
                 GLUT_STENCIL:使用模板緩存.
                 GLUT_MULTISAMPLE:讓窗口支持多例程.
                 GLUT_STEREO:使窗口支持立體.
                 GLUT_LUMINACE:luminance是亮度的意思.但是很遺憾,在多數(shù)OpenGL平臺上,不被支持.
            //******************************************************************************************
            (3)    void glutInitWindowPosition(int x, int y);
            設(shè)置初始窗口的位置(窗口左上角相對于桌面坐標(biāo)(x,y))
            //******************************************************************************************
            (4)    void glutInitWindowSize(int width, int height);
            設(shè)置初始窗口的大小
            //******************************************************************************************
            (5)    void glutMainLoop(void);
            讓glut程序進(jìn)入事件循環(huán).在一個glut程序中最多只能調(diào)用一次,且必須調(diào)用.一旦調(diào)用,會直到程序結(jié)束才返回.
            //******************************************************************************************
            (6)    void glutInitDisplayString(const char *string);
            通過一個字符串初始化display mode
            參數(shù):string:display mode的描述字符串
            這個描述字符串用在創(chuàng)建頂級窗口,子窗口和重疊層時,給將要被創(chuàng)建的窗口或重疊層設(shè)置display mode.
            這個字符串是由0個或多個功能描述參數(shù)組成,每個功能描述參數(shù)用空格或tab鍵隔開.(若未給參數(shù)限制緩存精度大小,則采用默認(rèn)值)

            例如:
            glutInitDisplayString("stencil~2 rgb double depth>=16 samples");
            上例將窗口初始化為至少2位的模板緩存,RGB模式alpha占用位數(shù)為0,深度緩存至少為16位,如果平臺支持的話使用mutlisampling技術(shù).
            可以使用的符號有:
            =   等號
            !=  不等號
            <   小于號(越小越好)
            >   大于號(越大越好)
            <=  小于等于(越小越好)
            >=  大于等于(盡可能選擇大的數(shù)值,主要用于顏色緩存或深度緩存等對位數(shù)要求高的參數(shù)設(shè)置)
            ~   大于等于(但盡可能選擇小的數(shù)值,有效利用資源,主要用于模板緩存等)
             
            主要參數(shù):
            alpha : alpaha緩存精度, 默認(rèn)值>=1,即大于等于1位;
            acca  : red, green, blue, 和alpha累積緩存精度, 默認(rèn)值>=1
            acc  :  red, green, blue累積緩存精度, 默認(rèn)值>=1,alpha累積緩存精度為0;
            blue :  blue顏色緩存精度, 默認(rèn)值>=1;
            buffer: 顏色索引緩存精度, 默認(rèn)值>=1;
            conformant :布爾值,指示幀緩存配置是否一致,該值基于GLX的EXT_visual_rationg擴展的支持,若不支持,則默認(rèn)為一致, 默認(rèn)值=1;
            depth : 深度緩存精度, 默認(rèn)值>=12;
            double: 布爾值,指示顏色緩存是否是雙倍緩存. 默認(rèn)值=1;
            green : green顏色緩存精度,默認(rèn)值>=1;
            index : 布爾值,指示是否為顏色索引,true表示是顏色索引, 默認(rèn)值>=1;
            num  :  專用名詞,指示數(shù)值表示的第n個幀緩存配置與這個描述字符串相符合的地方,當(dāng)沒有指定,則glutInitDisplayString也返回初始(最佳符合)配置.
            red :   red顏色緩存精度, 默認(rèn)值>=1;
            rgba :  rgba模式,顏色緩存精度默認(rèn)值>=1;
            rgb :   rgb模式,顏色緩存精度默認(rèn)值>=1,alpha精度=0;
            luminance: 設(shè)置red顏色緩存精度,默認(rèn)值>=1,其他顏色緩存精度=0(alpha沒有指定);
            stencil: 模板緩存精度
            single: 布爾值,指示顏色緩存是否為單緩存, 默認(rèn)值=1;
            stereo :布爾值,標(biāo)示顏色緩存支持OpenGL的三維系統(tǒng),默認(rèn)值=1;
            samples: 標(biāo)示multisamples的值,這個值是基于GLX的SGIS_multisample的擴展.默認(rèn)值<=4.這個默認(rèn)值表示如果支持的話可以在glutInitDisplayString中添加描述參數(shù)讓glut請求multipsampling;
            slow :  布爾值,標(biāo)示幀緩存配置是否是slow的.對于X11對glut的執(zhí)行,slow信息是基于GLX的EXT_visual_rating擴展的支持,如果不支持,就認(rèn)為是fast;對于win32對glut的執(zhí)行,slow是基于像素格式描述(pixel format Descriptor即PFD)被標(biāo)記為"generic"并且未被標(biāo)記為"accelerated",這說明Microsoft關(guān)于slow的OpenGL執(zhí)行只用在PFD中.這個參數(shù)的作用是幫助程序避免對于當(dāng)前機器的幀緩存配置越來越慢.默認(rèn)值>=0,表示slow visuals優(yōu)先于fast visuals,但fast visuals仍然被允許.
            win32pdf : 只在win32系統(tǒng)中識別glut的請求,這個參數(shù)與win32中的像素格式(pixel format)相匹配,它的值是個數(shù)字
            xvisual: 只在X Window系統(tǒng)中識別glut的請求,這個參數(shù)與X visual ID相匹配,它的值是個數(shù)字
            xstaticgray:  只在X Window系統(tǒng)中識別glut請求,是個布爾值,標(biāo)示幀緩存配置的X visual是否是StaticGray. 默認(rèn)值=1
            xgrayscale  : 只在X Window系統(tǒng)中識別glut的請求,是個布爾值,標(biāo)示幀緩存配置的X visual是否是GrayScale. 默認(rèn)值=1;
            xstaticcolor:  只在X Window系統(tǒng)中識別glut的請求,是個布爾值,標(biāo)示幀緩存配置的X visual是否是StaticColor. 默認(rèn)值=1;
            xpseudocolor : 只在X Window系統(tǒng)中識別glut的請求,是個布爾值,標(biāo)示幀緩存配置的X visual是否是PsuedoColor. 默認(rèn)值=1;
            xtruecolor  :  只在X Window系統(tǒng)中識別glut的請求,是個布爾值,標(biāo)示幀緩存配置的X visual是否是TrueColor. 默認(rèn)值=1;
            xdirectcolor : 只在X Window系統(tǒng)中識別glut的請求,是個布爾值,標(biāo)示幀緩存配置的X visual是否是DirectColor. 默認(rèn)值=1;
            //*******************************************************************************************
            網(wǎng)上沒有搜到關(guān)于glut的完整資料,于是下狠心自己花時間整理了一下.這里只是glut初始化的API,其中void glutInitDisplayString(const char *string);在國內(nèi)網(wǎng)站上沒搜到具體解釋,是從國外網(wǎng)站上翻譯過來的,本人英文水平有限,可能有錯誤,下面貼上英文原文,望達(dá)人指點.(其他API 會在以后分類后陸續(xù)給出).
             
            void glutInitDisplayString(const char *string)  - sets the initial display mode via a string.
            string:Display mode description string, see below.
            Description:
            The initial display mode description string is
            used  when creating top-level windows,subwindows,
            and overlays to determine the OpenGL display mode
            for the to-be-created window or overlay.
            The string is a list of zero or more capability
            descriptions separated by spaces and tabs.Each
            capability description is a capability name that
            is optionally followed by a comparator and a
            numeric value.For example,"double" and "depth>=12"
            are both valid criteria.
            The capability descriptions are translated into
            a set of criteria used to select the appropriate
            frame buffer  configuration.
            The criteria are matched in strict left to right
            order of precdence.That is,the first specified
            criteria(leftmost) takes precedence over the later
            criteria for nonexact criteria (greater than,less
            than,etc.comparators).Exact criteria (equal, not
            equal compartors) must match exactly so precedence
            is not relevant.
            The numeric value is an integer that is parsed
            according to ANSI C's strtol(str,strptr,0) behavior.
            This means that decimal,octal(leading 0),and
            hexidecimal values(leading 0x) are accepeted.
            The valid compartors are:
            =  Equal.
            != Not equal.
            <  Less than and preferring larger difference
               (theleast is best).
            >  Greater than and preferring larger differences
               (the most is best).
            <= Less than or equal and preferring larger
               difference(the least is best).
            >= Greater than or equal and preferring more
               instead of less. This comparator is useful for
               allocating resources like color precsion or
               depth buffer precision where the maximum
               precison is generally preferred.Contrast with
               the tilde (~) comprator.
            ~  Greater than or equal but preferring less
               instead of more.This compartor is useful for
               allocating resources such as stencil bits or
               auxillary color buffers where you would rather
               not over allocate.
               When the compartor and numeric value are not
               specified,each capability name has a different
               default(one default is to require a compartor
               and numeric value).
            The valid capability names are:
            alpha:Alpha color buffer precision in bits.Default
                  is ">=1".
            acca:Red,green,blue,and alpha accumulation buffer
                 precision in bits.Default is ">=1" for red,
                 green,blue,and alpha capabilities.
            acc:Red,green,and green accumulation buffer
                precision in bits and zero bits of alpha
                accumulation buffer precision.Default is ">=1"
                for red,green,and blue capabilities,and "~0"
                for the alpha capability.
            blue:Blue color buffer precision in bits.Default
                 is ">=1".
            buffer:Number of bits in the color index color
                   buffer.Default is ">=1".
            conformant:
                   Boolean indicating if the frame buffer
                   configuration is conformant or not.
                   Conformance information is based on GLX's
                   EXT_visual_rating extension if supported.
                   If the extension is not supported,all
                   visuals are assumed conformat.Default is
                   "=1".
            depth:Number of bits of precsion in the depth
                  buffer.Default is ">=12".
            double:Boolean indicating if the color buffer is
                   double buffered.Default is "=1".
            green:Green color buffer precision in bits.Default
                  is ">=1".
            index:Boolean if the color model is color index or
                  not.True is color index.Default is ">=1".
            num:A special capability name indicating where the
                value represents the Nth frame buffer
                configuration matching the description string.
                When  not specified,glutInitDisplayString also
                returns the first(best matching) configuration.
                num requires a compartor and numeric value.
            red;Red color buffer precision in bits.Default is
                    ">=1".
            rgba:Number of bits of red,green,blue,and  alpha
                 in the RGBA color buffer.Default is ">=1"
                 for red,green,blue,and alpha capabilities,
                 and "=1"  for the RGBA color model capability.
            rgb:Number of bits of red,green,and blue in the
                RGBA color buffer and zero bits of alpha color
                buffer precision.Default  is ">=1" for the red,
                green,and blue capabilities,and "~0" for alpha
                capability,and "=1" for the RGBA color model
                capability.
            luminance:
                Number of bits of red in the RGBA and zero
                bits of green,blue(alpha not specified) of
                color buffer precision.Default is ">=1"
                for the red capabilitis,and "=0" for the green
                and blue capabilities,and "=1" for the RGBA
                color model capability,and,for X11,"=1" for the
                StaticGray ("xstaticgray")capability.SGI
                InfiniteReality(and other future machines)
                support a 16-bit luminance (single channel)
                display mode(an additional 16-bit alpha channel
                can also be requested).The red channel maps to
                gray scale and green and blue channels are not
                available.A 16-bit precision luminance display
                mode is often appropriate for medical imaging
                applications.Do not expect many machines to
                support extended precision luminance display
                modes.
            stencil:Number of bits in the stencil buffer.
            single:Boolean indicate the color buffer is single
                   buffered.Double buffer capability "=1".
            stereo:Boolean indicating the color buffer is
                   supports OpenGL-style stereo.Default is "=1".
            samples:Indicates the number of multisamples to use
                    based on GLX's SGIS_multisample extension(for
                    antialiasing).Default is "<=4". This default
                    means that a GLUT application can request
                    multipsampling if available by simply
                    specifying "samples".
            slow:Boolean indicating if the frame buffer
                 configuration is slow or not.For the X11
                 implementation of GLUT,slowness information is
                 based on GLX's EXT_visual_rating extension if
                 supported.If the EXT_visual_rating extension is
                 not supported,all visuals are assumed fast.For
                 the Win32 implementation of GLUT,slowness is
                 based on if the underlying Pixel Format Descriptor
                 (PFD)is marked "generic" and not "accelerated".
                 This implies that Microsoft's relatively slow
                 software OpenGL implementation is used by this
                 PFD.Note that slowness is a relative designation
                 relative to other frame buffer configurations
                 available.The intent of the slow capability is to
                 help programs avoid frame buffer configurations
                 that are slower(but perhaps higher precision) for
                 the current machine.Default is ">=0" if not
                 comparator and numeric value are provided.This
                 default means that slow visuals are used in
                 preference to fast visuals,but fast visuals will
                 still be allowed.
            win32pfd:
                 Only recognized on GLUT implementations for Win32,
                 this  capability name matches the Win32 Pixel For-
                 mat Descriptor by numer.  win32pfd requires a com-
                 partor and numeric value.
            xvisual:Only recongized on GLUT implementations for the
                    X Window System,this capability name matches
                    the X visual ID by number.xvisual requires a
                    compartor and numeric value.
            xstaticgray:
                    Only recongized on GLUT implementations for the
                    X Window System,boolean indicating if the frame
                    buffer configuration's X visual is of type Stat-
                    icGray.Default is "=1".
            xgrayscale:
                    Only recongized on GLUT implementations for the
                    X Window System,boolean indicating if the frame
                    buffer configuration's X visual is of type
                    GrayScale.Default is "=1".
            xstaticcolor:
                    Only recongized on GLUT implementations for the
                    X Window System,boolean indicating if the frame
                    buffer configuration's X visual is of type
                    StaticColor.Default is "=1".
            xpseudocolor:
                    Only recongized on GLUT implementations for the
                    X Window System,boolean indicating if the frame
                    buffer configuration's X visual is of type
                    PsuedoColor.Default is "=1".
            xtruecolor:
                    Only recongized on GLUT implementations for the
                    X Window System,boolean indicating if the frame
                    buffer configuration's X visual is of type
                    TrueColor.Default is "=1".
            xdirectcolor:
                    Only recongized on GLUT implementations for the
                    X Window System,boolean indicating if the frame
                    buffer configuration's X visual is of type
                    DirectColor.Default is "=1".
            Unspecifed capability descriptions will result in
            unspecified criteria being generated.These unspecified
            criteria help glutInitDisplayString behave sensibly
            with terse display mode description strings.For
            example,if no "slow" capability description is provided,
            fast frame buffer configurations will be choosen in
            preference to slow frame buffer configurations,but slow
            frame  buffer  configurations will still be choosen if
            no better fast frame buffer configuration is available.
            Example:
            Here is an examples using glutInitDisplayString:
            glutInitDisplayString("stencil~2 rgb double depth>=16 samples");
            The above call requests a window with an RGBA color
            model(but requesting no bits of alpha),a depth buffer
            with at least 16 bits of precsion but preferring more,
            mutlisampling if available,and at least 2 bits of
            stencil(favoring less stencil to more as long as 2 bits
            are available).

            posted @ 2009-03-03 15:15 小蟲蟲 閱讀(907) | 評論 (0)編輯 收藏

            (轉(zhuǎn))glut中去掉控制臺

            *文章轉(zhuǎn)自:http://old.blog.edu.cn/user3/zjdukang/archives/2007/1765297.shtml
                glut是OpenGL應(yīng)用工具包(OpenGL Utility Toolkit),它為OpenGL提供了一個簡易的窗口平臺,使程序員不用過多的關(guān)心與平臺相關(guān)的窗口系統(tǒng).

                建立工程時,我們一般都建立控制臺程序(在vc6中即console win32 application)來使用glut庫.但是在控制臺程序下,運行時都會跳出控制臺窗口,很不美觀,我們可以用下面的方法將控制臺窗口去掉:
            #pragma comment( linker,"/subsystem:\"windows\" /entry:\"mainCRTStartup\"" )
            在主函數(shù)所在的.cpp文件的頂部加上上面的宏,就可以輕松將控制臺窗口去掉,這樣就只剩下glut窗口了.

            posted @ 2009-03-03 15:10 小蟲蟲 閱讀(572) | 評論 (0)編輯 收藏

            glut函數(shù)說明

                 摘要: Normal 0 7.8 磅 0 2 false false false MicrosoftInternetExplorer4 st1\:*{behavior:url(#ieooui) } /* Style Definitions */ table.MsoNormalT...  閱讀全文

            posted @ 2009-03-03 15:02 小蟲蟲 閱讀(777) | 評論 (0)編輯 收藏

            VC下OpenGL配置以及glut配置

            OpenGL官方網(wǎng)站(英文)
            http://www.opengl.org

            下面我將對Windows下的OpenGL編程進(jìn)行簡單介紹。

            第一步:選擇一個編譯環(huán)境   

            現(xiàn)在Windows系統(tǒng)的主流編譯環(huán)境有Visual Studio,Broland C++ Builder,Dev-C++等,它們都是支持OpenGL的。但這里我們選擇VC++ 6.0作為學(xué)習(xí)OpenGL的環(huán)境。   

            第二步:安裝GLUT工具包   

            GLUT不是OpenGL所必須的,但它會給我們的學(xué)習(xí)帶來一定的方便,推薦安裝。   

            Windows環(huán)境下的GLUT下載地址:(大小約為150k)   
            http://www.opengl.org/resources/libraries/glut/glutdlls37beta.zip  

            無法從以上地址下載的話請使用下面的連接:   
            http://upload.programfan.com/upfile/200607311626279.zip    

            Windows環(huán)境下安裝GLUT的步驟:   
            1、將下載的壓縮包解開,將得到5個文件
            2、以我的安裝目錄為例:   
            (1)“d:\Program Files\Microsoft Visual Studio\VC98\include\GL文件夾”。把解壓得到的glut.h放到這個GL文件夾里。沒有GL文件夾可以自己建一個,一般都有的。
            (2)“d:\Program Files\Microsoft Visual Studio\VC98\lib文件夾”。把解壓得到的glut.lib和glut32.lib放到靜態(tài)函數(shù)庫所在文件夾,即lib文件夾。
            (3)把解壓得到的glut.dll和glut32.dll放到操作系統(tǒng)目錄下面的system32文件夾內(nèi)。(典型的位置為:C:\Windows\System32)這是非常重要的動態(tài)鏈接庫設(shè)置! 

            第三步,創(chuàng)建工程,其步驟如下:   

            (1)創(chuàng)建一個Win32 Console Application。(以我創(chuàng)建的為例,工程名為simpleGL)   
            (2)鏈接OpenGL libraries:在Visual C++中先單擊Project,再單擊Settings,再找到Link單擊,最后在Object/library modules 的最前面加上opengl32.lib Glut32.lib Glaux.lib glu32.lib 。   
            (3)單擊Project Settings中的C/C++標(biāo)簽,將Preprocessor definitions 中的_CONSOLE改為__WINDOWS。最后單擊OK。  

            現(xiàn)在,準(zhǔn)備工作基本上完成了,可不要輕視這一步,如果你沒有設(shè)置好在編譯及運行過程中總會出錯的。

            對于VS2005可以如下設(shè)置:
            1、把 glut.h 復(fù)制到 VC 安裝路徑下的 PlatFormSDK\include\gl 文件夾
            2、把 glut32.lib 復(fù)制到 VC 安裝路徑下的 PlatFormSDK\lib 文件夾
            3、把 glut32.dll 復(fù)制到 Windows\System32 文件夾
            4、在 VC 中創(chuàng)建控制臺應(yīng)用程序,在選項中清除“使用預(yù)編譯頭”(以免影響可移植性)
            5、在 VC 中打開項目->屬性對話框進(jìn)行如下設(shè)置:
                    將“配置”下拉框選則為“所有配置”
                    打開 “鏈接器--輸入”項
                    在“附加依賴項”中增加:
                    OpenGL32.lib
                    glu32.lib
                    glut32.lib

            第四步,創(chuàng)建一個最簡單的opengl程序

            #include <GL/glut.h>

            void myDisplay(void)
            {
                glClear(GL_COLOR_BUFFER_BIT);
                glRectf(-0.5f, -0.5f, 0.5f, 0.5f);
                glFlush();
            }

            int main(int argc, char *argv[])
            {
               
            glutInit(&argc, argv);
                glutInitDisplayMode(GLUT_RGB | GLUT_SINGLE);
                glutInitWindowPosition(100, 100);
                glutInitWindowSize(400, 400);
                glutCreateWindow("第一個OpenGL程序");
                glutDisplayFunc(&myDisplay);
                glutMainLoop();
                return 0;
            }

            該程序的作用是在一個黑色的窗口中央畫一個白色的矩形。下面對各行語句進(jìn)行說明。

            首先,需要包含頭文件#include<GL/glut.h>,這是GLUT的頭文件。
            本來OpenGL程序一般還要包含<GL/gl.h>和<GL/glu.h>,但GLUT的頭文件中已經(jīng)自動將這兩個文件包含了,不必再次包含。

            然后看main函數(shù)。
            int main(int argc, char *argv[]),這個是帶命令行參數(shù)的main函數(shù),各位應(yīng)該見過吧?沒見過的同志們請多翻翻書,等弄明白了再往下看。
            注意main函數(shù)中的各語句,除了最后的return之外,其余全部以glut開頭。這種以glut開頭的函數(shù)都是GLUT工具包所提供的函數(shù),下面對用到的幾個函數(shù)進(jìn)行介紹。
            1、glutInit,對GLUT進(jìn)行初始化,這個函數(shù)必須在其它的GLUT使用之前調(diào)用一次。其格式比較死板,一般照抄這句glutInit(&argc, argv)就可以了。
            2、glutInitDisplayMode,設(shè)置顯示方式,其中GLUT_RGB表示使用RGB顏色,與之對應(yīng)的還有GLUT_INDEX(表示使用索引顏色)。GLUT_SINGLE表示使用單緩沖,與之對應(yīng)的還有GLUT_DOUBLE(使用雙緩沖)。更多信息,請自己Google。當(dāng)然以后的教程也會有一些講解。
            3、glutInitWindowPosition,這個簡單,設(shè)置窗口在屏幕中的位置。
            4、glutInitWindowSize,這個也簡單,設(shè)置窗口的大小。
            5、glutCreateWindow,根據(jù)前面設(shè)置的信息創(chuàng)建窗口。參數(shù)將被作為窗口的標(biāo)題。注意:窗口被創(chuàng)建后,并不立即顯示到屏幕上。需要調(diào)用glutMainLoop才能看到窗口。
            6、glutDisplayFunc,設(shè)置一個函數(shù),當(dāng)需要進(jìn)行畫圖時,這個函數(shù)就會被調(diào)用。(這個說法不夠準(zhǔn)確,但準(zhǔn)確的說法可能初學(xué)者不太好理解,暫時這樣說吧)。
            7、glutMainLoop,進(jìn)行一個消息循環(huán)。(這個可能初學(xué)者也不太明白,現(xiàn)在只需要知道這個函數(shù)可以顯示窗口,并且等待窗口關(guān)閉后才會返回,這就足夠了。)

            在glutDisplayFunc函數(shù)中,我們設(shè)置了“當(dāng)需要畫圖時,請調(diào)用myDisplay函數(shù)”。于是myDisplay函數(shù)就用來畫圖。觀察 myDisplay中的三個函數(shù)調(diào)用,發(fā)現(xiàn)它們都以gl開頭。這種以gl開頭的函數(shù)都是OpenGL的標(biāo)準(zhǔn)函數(shù),下面對用到的函數(shù)進(jìn)行介紹。
            1、glClear,清除。GL_COLOR_BUFFER_BIT表示清除顏色,glClear函數(shù)還可以清除其它的東西,但這里不作介紹。
            2、glRectf,畫一個矩形。四個參數(shù)分別表示了位于對角線上的兩個點的橫、縱坐標(biāo)。
            3、glFlush,保證前面的OpenGL命令立即執(zhí)行(而不是讓它們在緩沖區(qū)中等待)。其作用跟fflush(stdout)類似。

            posted @ 2009-03-03 14:57 小蟲蟲 閱讀(20510) | 評論 (10)編輯 收藏

            僅列出標(biāo)題
            共3頁: 1 2 3 
            <2025年6月>
            25262728293031
            1234567
            891011121314
            15161718192021
            22232425262728
            293012345

            導(dǎo)航

            統(tǒng)計

            常用鏈接

            留言簿(5)

            隨筆分類

            隨筆檔案

            搜索

            最新評論

            閱讀排行榜

            評論排行榜

            97精品伊人久久大香线蕉| 91精品久久久久久无码| 久久精品人妻一区二区三区| 9999国产精品欧美久久久久久| 麻豆精品久久久一区二区| 久久九九免费高清视频| 久久久亚洲AV波多野结衣| av午夜福利一片免费看久久| 久久国产福利免费| 中文字幕热久久久久久久| AAA级久久久精品无码片| 精品久久久无码中文字幕| 久久久久久久久波多野高潮| 久久精品国产亚洲av水果派| 美女久久久久久| 国产午夜福利精品久久2021| 久久se精品一区二区影院| 99久久精品午夜一区二区| 久久久久一级精品亚洲国产成人综合AV区| 亚洲综合久久夜AV | 国产午夜精品久久久久九九电影 | 欧美日韩成人精品久久久免费看 | 久久99毛片免费观看不卡| 三级韩国一区久久二区综合| 久久国产高清字幕中文| 亚洲中文字幕无码久久2017 | 久久久久国产一级毛片高清版| 久久成人精品| 国内精品久久久久久久久电影网| 精品国产99久久久久久麻豆| 人人狠狠综合久久亚洲高清| 国产2021久久精品| 久久99精品国产一区二区三区| 亚洲AV无码久久精品色欲| 亚洲&#228;v永久无码精品天堂久久 | 国产成人久久精品二区三区| 99久久99久久精品免费看蜜桃| 久久精品日日躁夜夜躁欧美| 狠狠色丁香久久婷婷综合图片| 久久久精品久久久久久| 久久婷婷五月综合色99啪ak|