Click here to Skip to main content
15,918,049 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: When does Message Queue get created in window programming? Pin
CPallini20-Dec-09 7:33
mveCPallini20-Dec-09 7:33 
AnswerRe: When does Message Queue get created in window programming? Pin
«_Superman_»20-Dec-09 4:51
professional«_Superman_»20-Dec-09 4:51 
AnswerRe: When does Message Queue get created in window programming? Pin
Prabhu09200920-Dec-09 20:12
Prabhu09200920-Dec-09 20:12 
QuestionStrange Initialize.......... Pin
milestanley19-Dec-09 17:49
milestanley19-Dec-09 17:49 
AnswerRe: Strange Initialize.......... Pin
Chris Losinger19-Dec-09 19:31
professionalChris Losinger19-Dec-09 19:31 
AnswerRe: Strange Initialize.......... Pin
Richard MacCutchan19-Dec-09 21:40
mveRichard MacCutchan19-Dec-09 21:40 
AnswerRe: Strange Initialize.......... Pin
«_Superman_»20-Dec-09 4:57
professional«_Superman_»20-Dec-09 4:57 
Questionhow to use this code ?? Pin
a04.lqd19-Dec-09 6:19
a04.lqd19-Dec-09 6:19 
i have this code to load a bmp picture. but i don't know how to use it.!!!

<br />
#include "stdafx.h"<br />
#include "glaux.h"<br />
#include "glut.h"<br />

<br />
GLuint    texture[6];<br />

<br />
int LoadGLTextures()<br />
{<br />
    int Status=FALSE;                                    // Status Indicator<br />
<br />
    AUX_RGBImageRec *TextureImage[1];                    // Create Storage Space For The Texture<br />
<br />
    memset(TextureImage,0,sizeof(void *)*2);               // Set The Pointer To NULL<br />
<br />
    // Load The Bitmap, Check For Errors, If Bitmap's Not Found Quit<br />
    if (TextureImage[0]=LoadBMP("apple.bmp"))<br />
    {<br />
        Status=TRUE;                                    // Set The Status To TRUE<br />
<br />
        glGenTextures(3, &texture[0]);      // Create Three Textures<br />
        // Create Nearest Filtered Texture<br />
        glBindTexture(GL_TEXTURE_2D, texture[0]);<br />
        glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_NEAREST); // ( NEW )<br />
        glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_NEAREST); // ( NEW )<br />
        glTexImage2D(GL_TEXTURE_2D, 0, 3, <br />
        TextureImage[0]->sizeX, TextureImage[0]->sizeY,0, GL_RGB, GL_UNSIGNED_BYTE, TextureImage[0]->data);<br />
<br />
        // Create Linear Filtered Texture<br />
        glBindTexture(GL_TEXTURE_2D, texture[1]);<br />
        glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);<br />
        glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR);<br />
        glTexImage2D(GL_TEXTURE_2D, 0, 3, <br />
        TextureImage[0]->sizeX, TextureImage[0]->sizeY,0, GL_RGB, GL_UNSIGNED_BYTE, TextureImage[0]->data);<br />
<br />
        // Create MipMapped Texture<br />
        glBindTexture(GL_TEXTURE_2D, texture[2]);<br />
        glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);  // ( NEW )<br />
        glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR_MIPMAP_NEAREST);<br />
        gluBuild2DMipmaps(GL_TEXTURE_2D, 3, TextureImage[0]->sizeX,TextureImage[0]->sizeY, GL_RGB, GL_UNSIGNED_BYTE,TextureImage[0]->data);               // ( NEW )<br />
<br />
<br />
        if (TextureImage[0])                            // If Texture Exists<br />
        {<br />
            if (TextureImage[0]->data)            // If Texture Image Exists<br />
            {<br />
                free(TextureImage[0]->data);    // Free The Texture Image Memory<br />
            }<br />
            free(TextureImage[0]);                // Free The Image Structure<br />
        }<br />
    }<br />
<br />
    return Status;   <br />
}<br />
//-----------------------------------------------------------------------------<br />
AUX_RGBImageRec * LoadBMP(char *Filename)<br />
{<br />
    FILE *File=NULL;                                    // File Handle<br />
<br />
    if (!Filename)                                        // Make Sure A Filename Was Given<br />
    {<br />
        return NULL;                                    // If Not Return NULL<br />
    }<br />
<br />
    File=fopen(Filename,"r");                            // Check To See If The File Exists<br />
<br />
    if (File)                                            // Does The File Exist?<br />
    {<br />
        fclose(File);                                    // Close The Handle<br />
        return auxDIBImageLoad(Filename);                // Load The Bitmap And Return A Pointer<br />
    }<br />
<br />
    return NULL;   <br />
}<br />

AnswerRe: how to use this code ?? Pin
loyal ginger19-Dec-09 6:48
loyal ginger19-Dec-09 6:48 
GeneralRe: how to use this code ?? Pin
a04.lqd19-Dec-09 8:27
a04.lqd19-Dec-09 8:27 
GeneralRe: how to use this code ?? Pin
Rajesh R Subramanian19-Dec-09 8:37
professionalRajesh R Subramanian19-Dec-09 8:37 
GeneralRe: how to use this code ?? Pin
a04.lqd19-Dec-09 14:23
a04.lqd19-Dec-09 14:23 
GeneralRe: how to use this code ?? Pin
Tim Craig19-Dec-09 21:55
Tim Craig19-Dec-09 21:55 
GeneralRe: how to use this code ?? Pin
a04.lqd20-Dec-09 3:50
a04.lqd20-Dec-09 3:50 
GeneralRe: how to use this code ?? Pin
Tim Craig20-Dec-09 14:17
Tim Craig20-Dec-09 14:17 
GeneralRe: how to use this code ?? Pin
a04.lqd20-Dec-09 14:32
a04.lqd20-Dec-09 14:32 
GeneralRe: how to use this code ?? Pin
Tim Craig20-Dec-09 17:11
Tim Craig20-Dec-09 17:11 
Questionplese help me these error !! Pin
a04.lqd19-Dec-09 5:15
a04.lqd19-Dec-09 5:15 
AnswerRe: plese help me these error !! Pin
loyal ginger19-Dec-09 5:37
loyal ginger19-Dec-09 5:37 
Questionmay i have openGL version 1.1 or higher ??? Pin
a04.lqd19-Dec-09 4:51
a04.lqd19-Dec-09 4:51 
AnswerRe: may i have openGL version 1.1 or higher ??? Pin
CPallini19-Dec-09 4:56
mveCPallini19-Dec-09 4:56 
AnswerRe: may i have openGL version 1.1 or higher ??? Pin
Chris Losinger19-Dec-09 4:56
professionalChris Losinger19-Dec-09 4:56 
GeneralRe: may i have openGL version 1.1 or higher ??? Pin
Tim Craig19-Dec-09 9:23
Tim Craig19-Dec-09 9:23 
QuestionC to SQL Connentivity Pin
DarkSorrow3819-Dec-09 2:56
DarkSorrow3819-Dec-09 2:56 
AnswerRe: C to SQL Connentivity Pin
Richard MacCutchan19-Dec-09 3:06
mveRichard MacCutchan19-Dec-09 3:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.