]> git.tdb.fi Git - libs/gltk.git/blobdiff - source/resources.h
Add API declarations
[libs/gltk.git] / source / resources.h
index 52da3952916fb780cb873716d30f9381b86824d1..ce85b972aec6ecae2003054dc7cd8fa5a29176c0 100644 (file)
@@ -2,10 +2,15 @@
 #define MSP_GLTK_RESOURCES_H_
 
 #include <msp/gl/font.h>
+#include <msp/gl/module.h>
+#include <msp/gl/program.h>
+#include <msp/gl/sampler.h>
 #include <msp/gl/texture.h>
 #include <msp/datafile/collection.h>
+#include <msp/datafile/directorysource.h>
 #include <msp/fs/path.h>
 #include "graphic.h"
+#include "mspgltk_api.h"
 #include "style.h"
 
 namespace Msp {
@@ -15,12 +20,8 @@ namespace GLtk {
 Stores resources such as styles and graphics.  All widgets require a Resources
 instance in constructor.
 */
-class Resources: public DataFile::Collection
+class MSPGLTK_API Resources: public DataFile::Collection
 {
-private:
-       FS::Path path;
-       GL::Font *default_font;
-
 public:
        class Loader: public Collection::Loader
        {
@@ -32,19 +33,28 @@ public:
        private:
                void default_font(const std::string &);
                void font(const std::string &);
-               void style(const std::string &);
        };
 
+private:
+       FS::Path path;
+       GL::Font *default_font;
+       DataFile::DirectorySource *dir_src;
+
+public:
        Resources();
        Resources(const FS::Path &);
 private:
        void init();
-
 public:
-       void set_path(const FS::Path &);
+       ~Resources();
+
        const GL::Font &get_default_font() const;
+       const GL::Sampler &get_default_sampler() const;
+
 private:
-       GL::Font *create_font(const std::string &);
+       GL::Module *create_module(const std::string &);
+       GL::Program *create_program(const std::string &);
+       GL::Sampler *create_sampler(const std::string &);
        GL::Texture2D *create_texture(const std::string &);
 };