HELP - Debugging EYES ARE SQUARE!

This is a discussion on HELP - Debugging EYES ARE SQUARE! within the Game Programming forums, part of the General Programming Boards category; Hey could someone take a look at my code, Its just direct X, ive tried loads of stuff, Its probably ...

  1. #1
    Registered User
    Join Date
    Aug 2001
    Posts
    13

    HELP - Debugging EYES ARE SQUARE!

    Hey could someone take a look at my code, Its just direct X, ive tried loads of stuff, Its probably somthin stupid as im not the best of programmers, anyways heres the link.....

    www.btinternet.com/~ashley.canning/frodo.zip

    if you manage to solve the error :-) I hope you can, then could you send it to
    ashley.canning@btinternet.com

    Sorry if its asking a bit much, if so Maybe you could tell me what part is wrong and ill change it :-)

  2. #2
    Hamster without a wheel iain's Avatar
    Join Date
    Aug 2001
    Posts
    1,385
    hmmmm, i have a better idea, you post the code you think has a problem and then come back to look at the replies
    Monday - what a way to spend a seventh of your life

  3. #3
    Peace
    Join Date
    Aug 2001
    Posts
    1,510
    Its not that I wouldn't like to help, its just that I'm too lazy to go there, download that, unzip it, open it, run it, read it, test it, fix it, send it back... You get the picture. Like iain said: Post your errors or the relevant code and we'll take a peek at it.
    "There's always another way"
    -lightatdawn (lightatdawn.cprogramming.com)

  4. #4
    Registered User
    Join Date
    Sep 2001
    Location
    England
    Posts
    121
    Perhaps a hint as to what the program is meant to do, and what the error you are talking about is? I dont get any compile errors, just a couple of warnings, the resolution changes, screen clears and then it drops back to windows. I havent read your code properly yet but it doesnt look like it's supposed to do much more from it's length.

    The warnings:
    GameMain.cpp(26) : warning C4305: '=' : truncation from 'const long' to 'unsigned char'
    GameMain.cpp(26) : warning C4309: '=' : truncation of constant value

    The code:

    Code:
    #include "Globals.h"
    
    int GameMain()
    {
    	HRESULT hret;
    	memset(lpddsprimary,0,sizeof(LPDIRECTDRAWSURFACE4));
    
    	if(KEYDOWN(VK_ESCAPE)) { PostQuitMessage(0); }
    
    	CLEARMEM(ddsd);
    
    	hret = lpddsback->Lock(NULL, &ddsd, DDLOCK_WAIT | DDLOCK_SURFACEMEMORYPTR, NULL);
    	if(hret != DD_OK)
    	{		
    		ERR(hret);
    		return 1;
    	}
    
    	UCHAR *videomem = (UCHAR*)ddsd.lpSurface;
    
    
    	for(int x = 0; x < 500; x++)
    	{
    		for(int y = 0; y < 500; y++)
    		{
    	videomem[x + y * ddsd.lPitch] = _RGB(50,0,0); // warnings are on this line
    		}
    	}
    
    	hret = lpddsback->Unlock(NULL);
    	if(hret != DD_OK)
    	{		
    		ERR(hret);
    		return 1;
    	}
    
    	hret = lpddsprimary->Flip(NULL,DDFLIP_WAIT);
    	if(hret != DD_OK)
    	{		
    		ERR(hret);
    		return 1;
    	}
    
    	return 0;
    }

  5. #5
    bobish
    Guest
    from what was posted it looks like its suposed to draw pixels. However it seems that the pixels are not being drawn. I had that problem (and am still having) when learning direct draw to so I fell your pain. That doesn't i have the energy to download ad unzip so do us all a favor okay.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Tic Tac Toe Comp Move help
    By swgh in forum C++ Programming
    Replies: 5
    Last Post: 09-24-2008, 12:05 PM
  2. Loop seg error
    By Zishaan in forum Game Programming
    Replies: 2
    Last Post: 03-28-2007, 02:27 PM
  3. Forced moves trouble!!
    By Zishaan in forum Game Programming
    Replies: 0
    Last Post: 03-27-2007, 07:57 PM
  4. Help with my draughts game
    By Zishaan in forum C++ Programming
    Replies: 9
    Last Post: 03-24-2007, 08:33 AM
  5. Need another set of eyes for debugging...
    By jstn in forum C Programming
    Replies: 5
    Last Post: 06-04-2002, 11:55 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21