Beginner lesson 3 SOS

The Partridge Family were neither partridges nor a family. Discuss.
Post Reply
clive stormz
Posts: 4
Joined: August 16th, 2012, 8:10 pm

Beginner lesson 3 SOS

Post by clive stormz » June 11th, 2017, 1:37 am

I took a break from c++ and decided to pick it up again now with visual studio 2017 and windows 10.

I'm finding more problems than before, I managed to make it to lesson 3 and all but I can't get wnd.KeyIsPressed( VK_up ) to work when I build the solution I get identifier "wnd" is undefined .

I could really use some help here.

[/******************************************************************************************
* Chili DirectX Framework Version 11.12.17 *
* Game.cpp *
* Copyright 2011 PlanetChili.net *
* *
* This file is part of The Chili DirectX Framework. *
* *
* The Chili DirectX Framework is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation, either version 3 of the License, or *
* (at your option) any later version. *
* *
* The Chili DirectX Framework is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with The Chili DirectX Framework. If not, see <http://www.gnu.org/licenses/>. *
******************************************************************************************/
#include "Game.h"

Game::Game( HWND hWnd,const KeyboardServer& kServer )
: gfx ( hWnd ),
kbd( kServer )
{}

void Game::Go()
{
gfx.BeginFrame();
ComposeFrame();
gfx.EndFrame();
}

void Game::ComposeFrame()
{
const int x = 400;

const int y = 400;

const bool cond = wnd.kbd.KeyIsPressed( VK_UP );

if(cond)
// x axis y red green blue
gfx.PutPixel( -5 + x, y, 255, 255, 255);
gfx.PutPixel( -4 + x, y, 255, 255, 255);
gfx.PutPixel( -3 + x, y, 255, 255, 255);
gfx.PutPixel( 3 + x, y, 255, 255, 255);
gfx.PutPixel( 4 + x, y, 255, 255, 255);
gfx.PutPixel( 5 + x, y, 255, 255, 255);
gfx.PutPixel( x,-5 + y, 255, 255, 255);
gfx.PutPixel( x,-4 + y, 255, 255, 255);
gfx.PutPixel( x,-3 + y, 255, 255, 255);
gfx.PutPixel( x,3 + y, 255, 255, 255);
gfx.PutPixel( x,4 + y, 255, 255, 255);
gfx.PutPixel( x,5 + y, 255, 255, 255);
}]

[Severity Code Description Project File Line Suppression State
Error (active) E0020 identifier "wnd" is undefined Chili DirectX Framework c:\Users\user\Desktop\Chili DirectX Framework\Assets\Game.cpp 41
]
Last edited by clive stormz on June 11th, 2017, 10:27 am, edited 1 time in total.

User avatar
cyboryxmen
Posts: 190
Joined: November 14th, 2014, 2:03 am

Re: Beginner lesson 3 SOS

Post by cyboryxmen » June 11th, 2017, 4:29 am

Zekilk

clive stormz
Posts: 4
Joined: August 16th, 2012, 8:10 pm

Re: Beginner lesson 3 SOS

Post by clive stormz » June 11th, 2017, 10:43 am

I figured it out i was using an older version of the frame work that was missing the needed headers sorry.

User avatar
chili
Site Admin
Posts: 3948
Joined: December 31st, 2011, 4:53 pm
Location: Japan
Contact:

Re: Beginner lesson 3 SOS

Post by chili » June 11th, 2017, 4:00 pm

Seems like the framework version should not have been an issue, but glad you got it all sorted out at any rate.

Welcome back btw :D
Chili

Post Reply