Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
glVertexAttribPointer error
#15
Well that's the nature of OOP, we create classes that do things, and we define the classes as small easy to alter concepts that are transportable.

If you want a MyFiles, you simply include the header, which has the definition of the class. NOT THE ACTUAL CODE.
Then another "class" or "classes" can create a new instance of MyFiles, and use it to suit its particular needs.

Code that is plugged into other code, is not flexible, and can't be interchanged.

But any class can include a MyFiles class in its own make up, if it needs to load an image, or...as I use it, I create 1 instance of a filehandler in the main code, and pass its address to any other classes that want to use it, but those classes also need to know what the MyFiles class can do, so you include the header in them also.
So in a sense you do put the content of Myfiles.cpp in to GameProject1.cpp, but you access it by creating an instance of a class.

As I say...the nature of OOP, which is the key design concept of the C++ language.
Brian Beuken
Lecturer in Game Programming at Breda University of Applied Sciences.
Author of The Fundamentals of C/C++ Game Programming: Using Target-based Development on SBC's 



Reply


Messages In This Thread
glVertexAttribPointer error - by pahendriks - 03-16-2018, 07:16 PM
RE: glVertexAttribPointer error - by Brian Beuken - 03-16-2018, 07:29 PM
RE: glVertexAttribPointer error - by pahendriks - 03-16-2018, 07:44 PM
RE: glVertexAttribPointer error - by Brian Beuken - 03-16-2018, 07:46 PM
RE: glVertexAttribPointer error - by pahendriks - 03-16-2018, 07:51 PM
RE: glVertexAttribPointer error - by Brian Beuken - 03-16-2018, 07:45 PM
RE: glVertexAttribPointer error - by Brian Beuken - 03-16-2018, 07:57 PM
RE: glVertexAttribPointer error - by pahendriks - 03-16-2018, 08:14 PM
RE: glVertexAttribPointer error - by Brian Beuken - 03-16-2018, 08:22 PM
RE: glVertexAttribPointer error - by pahendriks - 03-16-2018, 08:32 PM
RE: glVertexAttribPointer error - by Brian Beuken - 03-16-2018, 08:41 PM
RE: glVertexAttribPointer error - by pahendriks - 03-16-2018, 09:08 PM
RE: glVertexAttribPointer error - by Brian Beuken - 03-16-2018, 09:18 PM
RE: glVertexAttribPointer error - by pahendriks - 03-16-2018, 09:28 PM
RE: glVertexAttribPointer error - by Brian Beuken - 03-16-2018, 09:45 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)