Cerasti

Members
  • Content count

    167
  • Joined

  • Last visited

Community Reputation

219 Neutral

About Cerasti

  • Rank
    Member
  1. Here's the log from the command line window: C:\Users\Martin\Desktop\Epoch Release 8\Tools>exegen /makeexe guessinggame.epoch guessinggame.exe EXEGEN - Epoch development toolkit [Plenty of stuff saying that the program has been built successfully] C:\Users\Martin\Desktop\Epoch Release 8\Tools>guessinggame C:\Users\Martin\Desktop\Epoch Release 8\Tools> This error is given when running the guessing game: Epoch Subsystem --------------------------- Failed to cast value; possible causes are overflow or malformed data
  2. I've been laying about with the latest Epoch release a little I've found some problems, so here's that feedback you were asking for. The sample programs don't function properly. The guessing game, which I'm quite positive I've managed to get working in release 7, throws an error at runtime about an illegal cast. The scribble project doesn't even build, giving me two inexplicable compile errors, and I had to move the project to the "Tools" folder because Exegen couldn't find the source files in a remote directory. When programs do run they appear to do nothing. A trivial example such as the one below, while building without errors, produces no output when run from the command line. entrypoint : () -> () { debugwritestring("Test") } Am I missing something here?
  3. I've been silently following this, and I'd like to pop in and throw a bucket of support at you. Interesting and inspiring project; I'll definitely have a look at this new release in a jiffy.
  4. I'm trying out the new C++0x features available in Visual Studio 2010 Beta 2, in particular the lambda expressions. I have however come across a curious error: in nested lambda functions, template parameters cease to exist. They do work in non-nested lambdas though. This code illustrates the problem which, to me, appears to be a bug in the compiler. I hope that I'm wrong. template <typename T> void f() { T x; // Works fine [](){ T y; // As does this one [](){ T z; // Not this one }; }; } int main() { f<int>(); } // error C2065: 'T' : undeclared identifier // error C2146: syntax error : missing ';' before identifier 'z' // error C3493: 'z' cannot be implicitly captured because no default capture mode has been specified Odd?
  5. Crisis of Faith?

    Are you sure you're not talking about me? Perhaps we're identical twins. Either way, I understand you and I hope that whatever decision you make will be the right one.
  6. Good C++ tuts/engine?

    An 'engine' is a pretty broad term. Engines can range from simple frameworks consisting only of the necessities, to big WYSIWYG-style editors. Engines can be tailored for a specific genre. Engines can be suited for certain types of graphics. Until you're being more specific, I'll throw a link to SFML which I think is a great little library for getting something up and running quickly.
  7. I would recommend looking into HSL/HSV, as I think it would make interpolating between colors (like SiCrane suggested) easier. You can then use a conversion routine to get them in the RGB format (First result on Google.)
  8. Thanks for the warning. It'll be a while before I start fiddling with a user interface, but I'll keep simplicity in mind.
  9. RPG Anvil: The Lua Tutorial Part 4

    Quick, to the point and easy to follow. Good job :)
  10. C#-esque properties in C++?

    I was very aware of the overhead added by boost when I posted this, hence "It's not the most efficient of doing it," but I'm sure this could be implemented using raw function pointers as well. Not that the overhead would be completely gone then either, though. I do see the reasoning here, and I'm probably better off sticking to foo.x(42) instead.
  11. C#-esque properties in C++?

    Writing x.y() = 42 seems pretty pointless to me, since it's practically the same thing as making y public. I'll admit though, that I've never even considered that you could write x.y(42), and that it is a bit shorter than what I'm used to. These semi-properties would mostly be a way of making things look nicer compared to the long accessor methods names I usually write (x.SetY(42)), which tend to become very ugly very quickly in longer expressions. Phantom, read only variables would be possible (as demonstrated by the code when trying to set y), but I'm not sure what you mean by validation of input; if you specify a custom accessor method you can add any kind of validation you like. I realize though that this is a bit of a hack, and perhaps not that useful after all. Thanks for the input [smile]
  12. I've never liked that C++ code so often is filled with getters and setters. C# has solved this very elegantly using properties, so this morning I tried to see if it was possible in C++ too. I did a quick search on this and did not find anything like it before, which leads me to believe that my idea must be tremendously flawed [grin] I typed up this implementation here, but beware -- I'm no C++ guru. #include <iostream> #include <boost/bind.hpp> #include <boost/function.hpp> /// /// Imitation of C#'s properties. Holds one value of type T and provides /// standard getters/setters which can be overridden. /// template <typename T> class Property { public: Property(const T& value) : value(value) { setter = boost::bind(&Property::DefaultSetter, this, _1, _2); getter = boost::bind(&Property::DefaultGetter, this, _1); } operator T() { return getter(value); } void operator =(const T& newValue) { setter(value, newValue); } // Function pointers to the getters/setters boost::function<const T& (const T&)> getter; boost::function<void (T&, const T&)> setter; // Standard accessors private: const T& DefaultGetter(const T& value) const { return value; } void DefaultSetter(T& oldValue, const T& newValue) { oldValue = newValue; } // Data private: T value; }; class Point { public: // Create some custom accessors const int& x_getter(const int& value) const { std::cout << "Getter for x called." << std::endl; return value; } void y_setter(int& oldValue, const int& newValue) { throw std::exception("Setter for y unavailable"); } Point() : x(0), y(0) { this->x.getter = boost::bind(&Point::x_getter, this, _1); this->y.setter = boost::bind(&Point::y_setter, this, _1, _2); } public: Property<int> x, y; }; int main(int, char**) { try { Point myPoint; // Try getter for the x value int temp = myPoint.x; // Fail on setter of y value myPoint.y = 9; } catch(std::exception& e) { std::cout << e.what() << std::endl; } system("pause"); } It's not the most efficient of doing it, and it's not complete, but it works as expected. The benefit of this is demonstrated in the main function: variables can be accessed in a traditional manner and still get the getter/setter functionality. So, thoughts?
  13. Editor GUI

    My first advice would be to write anything GUI-related using C# (or any .NET language), and enjoy the luxury of Windows Forms. If you don't want to take that route, then I highly recommend using a pre-made GUI library, such as Qt, wxWidgets or MFC. What you decide to choose depends on your requirements; all of these libraries comes with their pros and cons. Licensing, cross-platform support, needing of a "framework" to be installed on the end user's machine, etc. I for one didn't like Qt's GPL/LGPL license, and therefore chose not to use it. The Windows API is not really pleasant to work with, so I wouldn't advise you to use it. If it's a small editor then I guess it could work, though. It all depends on your requirements, as does threading. I doubt that you actually need to use threads for this (they tend to complicate things), but I can't tell because you've given so little information.
  14. Need ideas for my first game

    You could always try one of the C# workshop's projects (1, 2, 3.) I don't know if they are too easy or hard for you, but they seem to be very detailed.
  15. C++: Calling DLL

    You're probably looking for LoadLibrary and GetProcAddress. At the top of my head, the most simple usage would be: typedef int (*AwesomeFunction)(int); int WINAPI WinMain(...) { HMODULE awesomeLibrary = LoadLibrary("AwesomeLibrary.dll"); AwesomeFunction function = GetProcAddress(awesomeLibrary, "FunctionName"); int x = function(55); } That code is untested though, but I think it would work.