Avatar

Richard Bamford

About

Second year Computer Science student at the University of Hull. Interested in maths, physics and graphics.

Blog posts

C++ Abstract Data Type

The abstract data type (ADT) is a core piece of OOP architecture. They are created/defined/declared with a class, but, unlike normal classes they have a specific purpose which is to provide/export a "type". Almost everything can be expressed as an ADT which makes choosing between a ADT or not for a class is tricky and up to the programmers discretion.A definition of a ADT follows: class Person { p… Read more →


C++ Interfaces Explained

When designing a program, using interfaces improves the program by drastically lowering coupling. This first diagram, we can see that the EntityManager depends on the Renderer class. This is bad because programs should "depend upon abstractions not concretions", if the Renderer class changes then EntityManager will break too. Therefore we should 'fix' the Renderers interface so that other class th… Read more →


C++ Solving inheritance confusion with interfaces and mixins.

C++ OOP interfacing concepts are confused because they differ greatly by interpretation. Here i attempt to clear the water and define each one correctly. General rules are that there is no multiple inhertiance other than interfaces.Fundamental class typesPure Abstract Base ClassAlso known as: interfaceThe pure abstract base class is a class that contains only method signatures and cannot be instan… Read more →


C++ naming conventions

C++ Naming ConventionsFrom the book "Code Complete - 2nd Edition" Entity ClassName TypeName EnumeratedTypes localVariable routineParameter RoutineName() m_ClassVariable g_GlobalVariable CONSTANT MACRO Base_EnumeratedType Read more →


C++ Game Project - 1 - Rendering Fonts

Figured out how to render fonts using FreeType and OpenGL.OpenGL, C++ and FreeTypeLearning Points:Orthographic projections and the device coordinate system.Font metrics and FreeType library.Resource Pools and Factory designs.GLM library.References:https://www.freetype.org/freetype2/docs/tutorial/step2.htmlhttps://open.gl/https://learnopengl.com/In-Practice/Text-Rendering Read more →


C++ Game Project - 1 - Rendering Fonts

Figured out how to render fonts using FreeType and OpenGL.OpenGL, C++ and FreeTypeLearning Points:Orthographic projections and the device coordinate system.Font metrics and FreeType library.Resource Pools and Factory designs.GLM library.References:https://www.freetype.org/freetype2/docs/tutorial/step2.htmlhttps://open.gl/https://learnopengl.com/In-Practice/Text-Rendering Read more →


Programming Adventures 2 - Unity3D Translation

Programming Adventures 2 - Unity3D Translate When moving objects using gameObject.transform.translate(x,y,z), its direction is based on the object's local transformation.That means that a square object rotated 90 degrees right will translate +Y when translated by (10, 0, 0).This bug happens when trying to translate objects using world space vectors. SolutionThe solution is to use gameObject.transf… Read more →