Note that there are some explanatory texts on larger screens.

plurals
  1. POC++ How can I hide a public class?
    primarykey
    data
    text
    <p>I'm coding a game engine and I'm creating some resource base classes such as vertexes, textures, fonts, etc.</p> <p>Now I'm creating some basic classes that I want to be exposed to another programmer that uses these base classes, such as Image (uses textures), Text (uses fonts), Models (uses vertexes) etc</p> <p>The game engine is also exposed, so they can call it's functions and such for coding a game.</p> <p>But I don't want them to access the base classes at all, and I don't want it to conflict with their classes as well. For example, they might want to create a class named "Material" for something ingame but my resources already have a "Material" class, how can I avoid the conflict and even better, hide these base classes (so they don't mess with it and break something)?</p> <p><strong>Edit:</strong> For example, I have the exposed class <strong>Image</strong>. It contains private instances of a <em>Quad</em> and <em>Texture</em> base classes, and my resource manager makes sure there's always only one of these loaded (so I don't have duplicate textures/quads in memory).</p> <p><em>Texture</em> itself has a width/height, and manages the data loaded to the card. Same for <em>Quad</em>.</p> <p><strong>Image</strong> makes sure that when an image resize is requested, it changes everything that needs to be changed and reuploads the data to the card.</p> <p><em>Texture</em> and <em>Quad</em> are public because they're used nearly everywhere, there's the modules and some classes that apply effects to it.</p> <p>They (other programmers) can use <strong>Image</strong> as instances, for inheritance, or as members, since it manages itself, and I want only this <strong>Image</strong> class exposed, so they don't ever know there's a <em>Quad</em> and <em>Texture</em> classes and that it also doesn't interfere with their class naming as well.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload