Register    Login    Forum    Search    FAQ

Board index » Everything




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post Posted: January 15th, 2018, 5:16 pm 
 

Joined: September 1st, 2017, 10:46 pm
Posts: 15
Location: Mississippi, USA
I was following the youtube video and getting an error

Code:
error C2061: syntax error: identifier 'Graphics' (compiling source file Animation.cpp)
error C2061: syntax error: identifier 'Graphics' (compiling source file Character.cpp)
error C2065: 'gfx': undeclared identifier (compiling source file Character.cpp)
error C2228: left of '.PutPixel' must have class/struct/union (compiling source file Character.cpp)
note: type is 'unknown-type' (compiling source file Character.cpp)


The Code snippet from SpriteEffect.h
Spoiler:
Code:
namespace SpriteEffect
{
   class Chroma
   {
   public:
      Chroma(Color c)
         :
         chroma(c)
      {}
      void operator()(Color cSrc, int xDest, int yDest, Graphics& gfx) const
      {
         if (cSrc != chroma)
         {
            gfx.PutPixel(xDest, yDest, cSrc);
         }
      }
   private:
      Color chroma;
   };


https://github.com/JamesMFox/Sprite/tree/I14-DEV


Top 
 Profile  
Reply with quote  
 Post Posted: January 15th, 2018, 6:42 pm 
 

Joined: February 28th, 2013, 3:23 am
Posts: 2970
Location: Oklahoma, United States
Code:
// Your Graphics.h file includes
#pragma once
#include "ChiliWin.h"
#include <d3d11.h>
#include <wrl.h>
#include "ChiliException.h"
#include "Colors.h"
#include "Surface.h"
#include "Rect.h"
#include "SpriteEffect.h"
#include <cassert>

// Your SpriteEffect.h includes
#include <cassert>
#include "Graphics.h"
#include "Colors.h"


There is a circular dependency between Graphics.h and SpriteEffect.h. Remove #include SpriteEffect.h from Graphics.h.

_________________
If you think paging some data from disk into RAM is slow, try paging it into a simian cerebrum over a pair of optical nerves. - gameprogrammingpatterns.com


Top 
 Profile  
Reply with quote  
 Post Posted: January 15th, 2018, 7:14 pm 
 

Joined: September 1st, 2017, 10:46 pm
Posts: 15
Location: Mississippi, USA
Thank you! That solved the problem.


Top 
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
 
Post new topic Reply to topic  [ 3 posts ] 

Board index » Everything


 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
cron