Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
A

Archy_Yu

@Archy_Yu
About
Posts
25
Topics
13
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • please
    A Archy_Yu

    First! Thanks for you help! then, how could i copy the texture file to my compter along with the .exe! I could not understand you say.

    Graphics graphics game-dev help

  • My texture just didnot work! Anyone give a hand?
    A Archy_Yu
    Graphics database graphics question

  • My texture just didnot work! Anyone give a hand?
    A Archy_Yu

    not work,The program work well in others' computer,But failed again in my computer. My gpu is nViDIA, geforce G210M. I think it something with my gpu. But I knouw nothing about it Thanks all the same

    Graphics database graphics question

  • My texture Problem
    A Archy_Yu

    unsigned int ID; /** < 生成纹理的ID号 */
    int imageWidth; /** < 图像宽度 */
    int imageHeight; /** < 图像高度 */
    unsigned char *image; /** < 指向图像数据的指针 */
    FILE *pFile = 0;

    BITMAPINFOHEADER bitmapInfoHeader;
    BITMAPFILEHEADER header;

    unsigned char textureColors = 0;

    pFile = fopen("桌面.bmp", "rb");
    if(pFile == 0) return false;

    fread(&header, sizeof(BITMAPFILEHEADER), 1, pFile);

    if(header.bfType != BITMAP_ID)
    {
    fclose(pFile);
    return false;
    }

    fread(&bitmapInfoHeader, sizeof(BITMAPINFOHEADER), 1, pFile);

    imageWidth = bitmapInfoHeader.biWidth;
    imageHeight = bitmapInfoHeader.biHeight;

    if(bitmapInfoHeader.biSizeImage == 0)
    bitmapInfoHeader.biSizeImage = bitmapInfoHeader.biWidth *
    bitmapInfoHeader.biHeight * 3;

    fseek(pFile, header.bfOffBits, SEEK_SET);

    image = new unsigned char[bitmapInfoHeader.biSizeImage];

    fread(image, 1, bitmapInfoHeader.biSizeImage, pFile);

    for(int index = 0; index < (int)bitmapInfoHeader.biSizeImage; index+=3)
    {
    textureColors = image[index];
    image[index] = image[index + 2];
    image[index + 2] = textureColors;
    }

    fclose(pFile);
    glPixelStorei(GL_UNPACK_ALIGNMENT,1);

    glGenTextures(1, &ID);

    glBindTexture(GL\_TEXTURE\_2D, ID); 
    

    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
    glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_S,GL_REPEAT);
    glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_T,GL_REPEAT);

    gluBuild2DMipmaps(GL\_TEXTURE\_2D, 3, imageWidth, 
                  imageHeight, GL\_RGB, GL\_UNSIGNED\_BYTE, 
                  image); 
    

    glEnable(GL_TEXTURE_2D);
    glTexEnvf(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE,GL_REPLACE);

    glPushMatrix();
    glScaled(45.0,30.0,0);
    glBindTexture(GL_TEXTURE_2D, ID);
    glBegin(GL_QUADS);
    glTexCoord2f(0.0f, 0.0f); glVertex3f(-2.0f, -1.0f, 0.0f);
    glTexCoord2f(1.0f, 0.0f); glVertex3f(-2.0f, 1.0f, 0.0f);
    glTexCoord2f(1.0f, 1.0f); glVertex3f( 0.0f, 1.0f, 0.0f);
    glTexCoord2f(0.0f, 1.0f); glVertex3f( 0.0f, -1.0f, 0.0f);

    glEnd();
    glPopMatrix();

    GLvoid ReShapeGLScene( GLsizei width,GLsizei height )
    {
    glViewport(0,0,(GLsizei)width,(GLsizei)height);
    glMatrixMode(GL_PROJECTION);
    glLoadIdentity();
    glOrtho((GLdouble)-450.0,(GLdouble)450.0,(GLdouble)-300.0,(GLdouble)300.0,50.0,-10.0);
    glMatrixMode(G

    C / C++ / MFC help

  • My texture Problem
    A Archy_Yu

    I read data from a bmp file,and use it as a texture,but it just failed,which work well on others' computer,My code is no problem.Any help is appreciated .Thanks!

    C / C++ / MFC help

  • please
    A Archy_Yu

    The program in OpenGL with Texture just didnot work in my cimputer,which work well in others' computer. where is the crux,any help is appreciated. The code is in the former message.

    Graphics graphics game-dev help

  • My texture just didnot work! Anyone give a hand?
    A Archy_Yu

    unsigned int ID; /**< 生成纹理的ID号 */
    int imageWidth; /**< 图像宽度 */
    int imageHeight; /**< 图像高度 */
    unsigned char *image; /**< 指向图像数据的指针 */
    FILE *pFile = 0;

    BITMAPINFOHEADER bitmapInfoHeader;
    BITMAPFILEHEADER header;
    
    unsigned char textureColors = 0; 
    
    pFile = fopen("桌面.bmp", "rb");
    	if(pFile == 0) return false;
    
    fread(&header, sizeof(BITMAPFILEHEADER), 1, pFile);
     
    if(header.bfType != BITMAP\_ID)
       {
    	   fclose(pFile);             
    	   return false;
       }
    
    fread(&bitmapInfoHeader, sizeof(BITMAPINFOHEADER), 1, pFile);
    
    imageWidth = bitmapInfoHeader.biWidth;
    imageHeight = bitmapInfoHeader.biHeight;
    

    if(bitmapInfoHeader.biSizeImage == 0)
    bitmapInfoHeader.biSizeImage = bitmapInfoHeader.biWidth *
    bitmapInfoHeader.biHeight * 3;

    fseek(pFile, header.bfOffBits, SEEK\_SET);
    
     
    image = new unsigned char\[bitmapInfoHeader.biSizeImage\];
     
     
    fread(image, 1, bitmapInfoHeader.biSizeImage, pFile);
    
     
    for(int index = 0; index < (int)bitmapInfoHeader.biSizeImage; index+=3)
       {
    	   textureColors = image\[index\];
    	   image\[index\] = image\[index + 2\];
    	   image\[index + 2\] = textureColors;
       }
    
    fclose(pFile);    
    glPixelStorei(GL\_UNPACK\_ALIGNMENT,1);
     
    glGenTextures(1, &ID);
    
    glBindTexture(GL\_TEXTURE\_2D, ID);
    
    glTexParameteri(GL\_TEXTURE\_2D, GL\_TEXTURE\_MIN\_FILTER, GL\_LINEAR);
    glTexParameteri(GL\_TEXTURE\_2D, GL\_TEXTURE\_MAG\_FILTER, GL\_LINEAR);
    glTexParameteri(GL\_TEXTURE\_2D,GL\_TEXTURE\_WRAP\_S,GL\_REPEAT);
    glTexParameteri(GL\_TEXTURE\_2D,GL\_TEXTURE\_WRAP\_T,GL\_REPEAT); 	
    
    gluBuild2DMipmaps(GL\_TEXTURE\_2D, 3, imageWidth,
                      imageHeight, GL\_RGB, GL\_UNSIGNED\_BYTE,
                      image);
    
    glEnable(GL\_TEXTURE\_2D);
    glTexEnvf(GL\_TEXTURE\_ENV,GL\_TEXTURE\_ENV\_MODE,GL\_REPLACE);
    
    glPushMatrix();	 
    glScaled(45.0,30.0,0);	
    glBindTexture(GL\_TEXTURE\_2D, ID);
    glBegin(GL\_QUADS);					 
    	glTexCoord2f(0.0f, 0.0f); glVertex3f(-2.0f, -1.0f, 0.0f);	
    	glTexCoord2f(1.0f, 0.0f); glVertex3f(-2.0f,  1.0f, 0.0f);	
    	glTexCoord2f(1.0f, 1.0f); glVertex3f( 0.0f,  1.0f, 0.0f);	
    	glTexCoord2f(0.0f, 1.0f); glVertex3f( 0.0f, -1.0f, 0.0f);	
    	
    glEnd();	
    glPopMatrix();
    
    GLvoid ReShapeGLScene( GLsizei width,GLsizei height )
    {
    glViewport(0,0,(GLsizei)width,(GLsizei)height);
    glMatrixMode(GL\_PROJECTION);
    glLoadIdentity();
    glOrtho((GLdouble)-450.0,(GLdouble)450.0,(GLdouble)-300.
    
    Graphics database graphics question

  • Winpcap Wpcap.dll packet.all
    A Archy_Yu

    what is their functions? I am completely confused. When sending arp message in LAN,Winpcap is very nessecery? What is about it? any one help me? thanks in advance!

    C# question help

  • who recommand book about ood?
    A Archy_Yu

    I am trying to further my knowledge of Object Oriented Programming, and I have acknowledged that my main weakness in this area is the figuring out what objects I need, and how they should be designed.About the projects,what i have done,are all three-layer.I am tired of it. I want to fill this gap in my knowledge so I am looking for any suggestions from people who're familiar with OOD and have any recommendations.recommending book is very welcome! Thanks in advance.

    C / C++ / MFC oop question learning

  • [Message Deleted]
    A Archy_Yu

    my spelling mistake,sorry.

    C / C++ / MFC

  • [Message Deleted]
    A Archy_Yu

    nothing,I just want to join a MSN group,and make some friends with other country discuss qustion with them, and find the gap,and improve, my MSN email : archy_yu@sina.com contact me

    C / C++ / MFC

  • [Message Deleted]
    A Archy_Yu

    My fault,My spelling mistake,sorry. make a friend? my MSN emeil is : archy_yu@sina.com contact me?

    C / C++ / MFC

  • [Message Deleted]
    A Archy_Yu

    [Message Deleted]

    C / C++ / MFC

  • How to solve this,I have try my best!
    A Archy_Yu

    Windows has triggered a breakpoint in Gobang.exe.

    This may be due to a corruption of the heap, which indicates a bug in Gobang.exe or any of the DLLs it has loaded.

    This may also be due to the user pressing F12 while Gobang.exe has focus.

    The output window may have more diagnostic information.

    The text above is the message That show me when i debug my project. Do any body ever run across problem like this,help me.thanks in advance.

    C / C++ / MFC help debugging tutorial

  • IConverterSession
    A Archy_Yu

    As far as i know,This is because you project short of some dll file or dib file,you may find the msdn to find it yourself,it will be easy,good luck.

    C / C++ / MFC help tutorial

  • The format string which put into textbox
    A Archy_Yu

    i created a silverlight project,and add some TextBox control on it,but i want to format the string which put into the TextBox,for example the length,and ASCII or Unicode,But how could i achieve it,any one help me! Thank you in advance. ;P

    WPF help tutorial

  • A bug about MFC [modified]
    A Archy_Yu

    void CGobangView::OnDraw(CDC* pDC) { CGobangDoc* pDoc = GetDocument(); ASSERT_VALID(pDoc); m_chessboard.LoadBitmap(IDB_ChessBoard); //绑定位图 CGobangView::m_begin.LoadBitmap(IDB_Start); CGobangView::m_end.LoadBitmap(IDB_Stop); static int i=0; if(i==0) { CGobangView::Chessboard.CreateCompatibleDC(pDC); Chessboard.SelectObject(m_chessboard); CGobangView::Begin.CreateCompatibleDC(pDC); Begin.SelectObject(m_begin); CGobangView::End.CreateCompatibleDC(pDC); End.SelectObject(m_end); i=1; } else { } pDC->BitBlt(0,0,800,600,&Chessboard,0,0,SRCCOPY); // TODO: add draw code for native data here } The above is the code; i only modify the onDraw() function,and The others is the Generated code by MFC wizard.

    C / C++ / MFC c++ help graphics

  • A bug about MFC [modified]
    A Archy_Yu

    I create a MFC project,and print a Bitmap on it,but when run it and want to change the size of the Windows,it just can't,it will bugged and show the warning message below,besides when i move the window,it also show the warning message. Bebug Assertion Failed! Program:~~~~~~ file:wingdi.cpp line:~~~ for information on how your program can cause an assertion fail,see the VC++ documentation on asserts. any one can help me!Please. Thanks in advance. modified on Sunday, March 8, 2009 12:44 AM

    C / C++ / MFC c++ help graphics

  • about my career!
    A Archy_Yu

    I am not major in Computer science or software!But I am interested in Programming.And I am study it by myself!I have already read a lot of book!But i am still feel that it not enough.In this term,I will try to make some 2D Games To test my level. But any body can help me.What courses should i learn to become a good Programmer!for example "C++" or "C"! Thanks in advance! :)

    C / C++ / MFC c++ help tutorial career learning

  • Any one can help me with these code
    A Archy_Yu

    #pragma comment(lib,"Shlwapi.lib") I personly think the code above is to load a "dll" file。Am i right or not? Any one can help me and explain it to me, thanks. Besides, i am not good at English, and if there is any grammar mistake,Please point it out directly. thanks again.

    C / C++ / MFC help question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups