Advertisement Jump to content
  • Advertisement

Mawww

Member
  • Content Count

    128
  • Joined

  • Last visited

Community Reputation

212 Neutral

About Mawww

  • Rank
    Member
  1. Not sure about it, but maybe cygwin or mingw can cross compile to linux from windows. If your code is modular enough, you should just have to write a new Window (or Drawable or whatever interface name you use) that uses XLib (or another opengl window creation capable library) to create the window to get your program running under linux. You may also need to write some other functionalities, like the timer, but once again this can help you validate your design (if it's easy and you do not need to write code in many different places). For mac, I do not know if there is cross compiling tools available for windows. Anyway, most of the times, compiling is not enough to be sure the program will work, so the virtual machine will be needed to test.
  2. I think this is due to OBJECTS not having the path in it, so when you compile, your makefile search for 1.o, and not obj/1.o. As 1.o does not exists, it will recompile 1.cpp. Try prepending $OBJS_PATH to all objects. Also, you may be interested in $(wildcard src/*.cpp) to get SOURCES.
  3. I think the function you need is SetConsoleCursorInfo take a look at http://msdn.microsoft.com/en-us/library/ms686019(VS.85).aspx you can then just set the cursor as invisible.
  4. Mawww

    If... Else in C++

    you should have replaced yours commas with the 'and' operator (&&), nothing to do with the == operator. read the given link, your code should look like: if (x <= 1 && y <= 2) ... else if (x <=1 && y <=3) ...
  5. In your case you could simply have one constructor with a default value for dd : class a { private: int b, c, d; public: a(int bb, int cc, int dd = 0):b(bb),c(cc),d(dd) { // lots of stuff here bleh } };
  6. Take a look at the "teenage mutant ninja puppets" demo (search on pouet.net), There is no 2 player games, but the combat system is very interesting, and it's really close to what you seems to want.
  7. Another thing is that you should use typedefs instead of #defines to define your new types.
  8. Hi, i'm currently designing a system to render shadows maps (and other effects needing a render to texture). I'm inspiring from the 'Engine-Shadow Integration Question' thread First a definition so there is no confusion : What I call a Shader is a C++ object that defines the appearance of the shaded object, it owns a HardwareProgram which is a set of HardwareShader linked together. the HardwareProgram is what runs on the 3D card. Here is the problem : When I render my shadow map, I do not care about lighting and all that, so I do not want to have a complex normal mapping HardwareProgram running. I could just force a specific HardwareProgram, but it would not work for any shader that change the depth or that discard the fragment. My idea is to add to a Shader a new, optional, HardwareProgram that is used to render the object with a uniform-given color. That way if a Shader have the optional HardwareProgram, when I render a shadow map, I use it, if not I use a default one. The question i'm asking is : is that generic enough ? I cannot think of an effect that requires rendering to texture and that needs another shader than the normal one (for reflection/refraction rendering) or the plain color one (for shadow mapping). I thought that adding a uniform to tell the color we want to render into permit effects like detecting the object edges (by rendering each object with a unique color and applying a edge detection filter on that) Do anyone have an idea of an effect I cannot get with this architecture ? Any comment ? Thanks in advance.
  9. That is a little unclear, perhaps with some code we could see what happened... For the moment I have no idea about how it was implemented in the first time. Perhaps your had something running in the background when you got 105 fps, perhaps your code did it, but without any code it will be hard to tell.
  10. Good object oriented design rules says that we should prefer composition to inheritance. As Hodgman says, inheritance represent a "is a" relationship. Composition represent a 'has a'. In your case, using inheritance is a bad idea. Composition is better for what you want to do : Look at your controler object, wouldn't it be cool to have a "keyboard/mouse controler" and a "bezier curve controler", and even a "Smart AI controller". With composition you can change on the fly the controler of any object, with inheritance it is a compile time decision. Another thing is that your fields should not be public. By making them public you allow any one to call any method on these fields. It would be better if your object only allows 'safe' operations on its fields by providing methods to acces them only the way you want. Hope this help. Sorry for my english, it's 8am and I spent my night finishing a school project. (And english is not my mother tong).
  11. one solution is to create a hierarchy of classes, with a "widget" as root class. Widget-+-Window +-Button +-Label +-... the widget interface would provide a draw and an update method. a window will provide a way of adding widgets in it a button will provide a click notification ...
  12. I've got a similar setup (however, I ported from linux to windows). What you need to change is window creation/management code (with message pump) and timer. for window creation, you could use XLib (I do). It is the lowest level you can get, but it's a fairly complex api and you have to write a lot of code to get a window on the screen. There is also SDL (I have a SDL implementation too) which is simpler to put in place, without significant drawbacks (except depending on a 'non-standard' library).
  13. Mawww

    The other desktop thread... [56k suicide]

    here is mine... wmii with transparent terminals...
  14. Quote: I think you misunderstood me -- you basically illustrated the exact kind of simplicity I was referring to. They're straightforward and without frills, in particular, the developing of them it's vastly more simple than the developing an equivalent GUI tool, especially in C or C++. A command-line tool to perform some work that's part of somebody's research can be written with an overhead of a few lines, the equivalent GUI tool would require several more lines in GUI framework boilerplate, such as message pumps, et cetera). In that sense, I agree. each tool is relatively simple compared to a full blown IDE (Emacs is perhaps an exception, I do not know any IDE that contains a Rogerian psychoanalyst module ;-) But the combination of all those tools give you an development environment (that may be "integrated" via the editor if it support interfacing with all the tools). As french is my mothertong, I checked up, and in english 'simplistic' seems to always carry a negative connotation. It's that negative side I do not like, to me simple is better than overly complex. (and complex is better than overly simple...). My point is that unix-style command line tools are simple, no problem, but they interact very well with each others. And the power you can get by making these tools interact is very great. You can build very complex systems by using very simple tools, and I prefer this design.
  15. Mawww

    Logging

    On the design side, you may use a logger interface, and a different implementation, and a composite logger (not sure about the pattern name) [source lang=c++] class logger { public: virtual void log(const std::string& message) = 0 }; class disk_logger : public logger { ... } class net_logger : public logger { ... } class composite_logger : public logger { private: std::vector<logger*> m_loggers; public: void add(logger* logger) { m_loggers.push_back(logger); } void log(const std::string& message) { for each log in m_loggers log->log(message); } }; that way implementing a new logging method is a breeze. just use a composite logger with the others attached to it.
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!