Thanks guys.
I forgot to mention that I did call the function in my game loop.
And indeed, it is the unsigned char problem.
Type: Posts; User: Raison
Thanks guys.
I forgot to mention that I did call the function in my game loop.
And indeed, it is the unsigned char problem.
class Keyboard :
public Controller
{
public:
Keyboard(LPDIRECTINPUT8 pDI, HWND hwnd);
~Keyboard(void);
bool shutdown();
bool read();
void clear();
bool buttonDown(char key){ return...
What are the possible reasons why my directinput code can recognise normal keys like A-Z but it just doesnt recognise arrow keys like DIK_UP,DIK_LEFT,DIK_RIGHT,DIK_DOWN.
Hi darkness, thank you for ur elaborated explanation. I really think your suggestion is good.
// will be using a shrunken rect to represent round ball
Ball
-shrunkenX:double // coord of...
i have done a rough class diagram, will be using c++.
// this class will contain all game logic
Breakout
- level: int // for determine speed of game and width of paddle
- blockmap: int[][]...
I am intending to use opengl and win32API. They are something i self-taught myself and i want to put them into practice.
I will code as much as i can. Will post again when i have problem with the...
Hi guys, i intend to make a breakout game. But i dont know how to start. Can someone give me a direction or reference to making breakout? Mainly i need to know what kind of mathematical theory i...
He claimed he opened an unknown e-mail. There were two attachments but he didnt opened it. It crashed his pc and then that's how everything happened. I told him to restart in safe mode and scan his...
My friend's PC is now lagging very badly on startup. His PC seems to have alot of processor activities that he cant even start any application. When his processor finally stops processing, the system...
Thanks for the help. Your suggestion solved my problem. It took me a while to understand ur code. I managed to avoid the use of the stack ADT by storing the handle of the child window. Then I call...
I have a parent window of this style:
WS_CLIPCHILDREN | WS_OVERLAPPEDWINDOW & ~WS_THICKFRAME & ~WS_MAXIMIZEBOX
then i have a child window of this style:
WS_CHILD | WS_VISIBLE
I want my child...
Thanks for the reply, stan.
I coudnt startup the UPS. I get a "Error 2481: The UPS is not configured correctly" message. Guess I will go check up what is that message first.
wat could be the possible reasons my computer restarts by itself?? I was just reading some pdf file and my virus scan was running. Then all of the sudden, the computer restarts.
I always tot the compiler knows how to link them together. Guess I will start including headers inside the headers from now on
document.cpp:
#include <iostream>
#include <string>
#include "document.h"
using namespace std;
/*.........Implementations of class document....*/
Yes thanks, i am aware of that namespace danger. My program was just a small application, so i was lazy to specify the namespace. But it's really strange. I never had to include a library header in...
I was working with xemacs in unix. One of my c++ class header file has a string variable. E.g.:
document.h:
#ifndef DOC_H
#define DOC_H
#include <string>
using std::string;
if ((life_array[row-1][col-1])=='X')
num_neighbors++;
if ((life_array[row-1][col])=='X')
num_neighbors++;
//not right, i think
if...
if ((life_array[row][col])=='X') //If box has an X
{
num_neighbors=checkx(life_array[row][col],row,col);
if (num_neighbors != 3) //Conditions to...
Hmm, i have encountered yet another problem, so i'm gonna post it here.
// setup common controls
icc.dwSize = sizeof(INITCOMMONCONTROLSEX);
icc.dwICC = 0x00004000;//ICC_STANDARD_CLASSES...
I managed to solve the problem by adding PatBlt while handling WM_PAINT msg.
void mainFrame::mainWindow_onPaint(HWND hwnd)
{
PAINTSTRUCT ps;
HDC hDC = BeginPaint(hwnd,&ps);...
Removed all the ReleaseDC()s and EndPaint()...it still didnt work.
The strangest thing is that i checked the brush in the hDC using GetCurrentObject() and OBJ_BRUSH during every WM_PAINT msg. It has...
ack...sorry i was doing cut and paste to replicate the problem and the SelectBrush() wasn't there at first.
Here is the actual problem:
hDC = GetDC(hwnd);
HBITMAP hbitmap;
I am quite sure i can delete the bitmap before i select the brush. Anyway i tried to select it in without deleting the bitmap. It still didnt work.
I have only made one window. It has its own DC and it is suppose to retain any changes in its DC attributes right? So if I change the brush after creating the window, it should be able to paint the...