Maybe I’m just tired, or now I’m ready for a nap

compiler is pissed off:

1>pathsourcegameconsole.cpp(53) : error C2039: 'setPostiion' : is not a member of 'Ogre::OverlayElement'
1> pathsourceogreogremainincludeogreoverlayelement.h(104) : see declaration of 'Ogre::OverlayElement'

ogreoverlayelement.h

class _OgreExport OverlayElement : public StringInterface, public Renderable, public OverlayAlloc
{
// ...
public:
/** Sets the position of the top-left corner of the element, relative to the screen size (1.0 = screen width / height) */
void setPosition(Real left, Real top);


// ...
};

The header file and the API documentation both agree, the Ogre::OverlayElement class has a public member named setPosition. The compiler however seems to assert, that the header is wrong?

No, the compiler, the header, and the API docs are all right: I’ve just been sitting here for about 5 1/2 hours without break…. and can no longer tell the difference between ‘void setPosition(Real, Real);’ and ‘void setPostiion(Real, Real);’

!!! TIME TO TAKE A WALK !!!

Mating Vi IMproved with Visual C++, part I

Maybe it’s because it is an Integrated Development Environment, but Visual C++ seems to be a little lacking in its handling of external editors (at least in the express edition I have avail). It seems the best way to get MSVC to work with Vi IMproved for editing files, is to right click on a file in the solution explorer docklet, and click “Open with”. From there one can specify a program to open the file with and force it as the default editor; the down side is the bloody thing seems to reject the concept of command line arguments.

As such, I created a new win32 application in the IDE, and stripped the fundamental code down to the following

#define GVIM_EXE    _T("P:/Editors/Vim/vim-personal/gvim.exe")
#define GVIM_ARGS _T("--servername"), _T("MSVC"), _T("--remote-tab-silent")

int APIENTRY
_tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPTSTR lpCmdLine, int nCmdShow)
{
UNREFERENCED_PARAMETER(hPrevInstance);
UNREFERENCED_PARAMETER(hInstance);
UNREFERENCED_PARAMETER(nCmdShow);

_texecl(GVIM_EXE, _T("gvim"), GVIM_ARGS, lpCmdLine, NULL);

return 0;
}

Which means I get one instance of Vim running and double clicking files in the solution explorer, will open a new tab in the GVim window; gotta love an editor with a client-server feature hehe.

I have Michael Graz’s visual_studio.vim installed along with the required python for windows extensions. The plugin loads and appears to be exactly the *first* vim plugin that I can actually find a purpose for using! Except for one small problem…. the plugin can’t seem to chatter with the running instance of Visual C++ 2008 Express Edition!

Of course, I could likely jerry rig vim’s :make command to invoke vcbuild for me without much trouble.

Heh, and just for the heck of it, I wonder if a similar plugin could be written for other IDEs, like Code::Blocks, XCode, and KDevelop?

Hahaha, here I am wondering ok, what the hell is wrong with

if (statement that will return false)
DEBUG(...);
do action;

and then I noticed, uncommenting the DEBUG() macro a few minutes ago changed the dohicky.

This is exactly why whenever I’ve written a ‘style’ file for any of the projects I’ve done (and in fact, usually follow) a note that it should *always* be if () { } and never if () just for this reason!!!

Ok, I’m so freaking stupid… I should just get some sleep and code when I can pay attention (and remember my old tool Perl).

I’m kind of happy with myself at the moment. I’ve found that Visual Studio project files are about the only reliable way I can get things to compile with Visual C++’s compiler on my lone windows machine. Since i greatly prefer using a command prompt for development work, having to alt tab between programs like VCExpress/devenv and Explorer windows are not something I’ll put up with if I don’t have to lol.

Since I do require a real mans editor, I set the IDE to load gvim as the default editor for source files; soon I’ll rig it to use vim’s client-server feature (:he client-server). Like wise that made Visual C++ little more then a very big project management and build system. Some weeks ago whilst looking for cl/link (compiler/linker) switches and a reference to nmake (Microsoft’s make utility), I found the vcbuild utility; which is the “Visual C++ Project Builder – Command Line Version”. So far it seems to be very suitable, which would mean the IDE is now only needed for managing the project and solution files, right? Well, not really!

When I started using Microsoft’s development environment (this box only has the Express editions; I usually do development on my FreeBSD powered laptop!) the first thing I did was look at the .sln and .vcproj files it creates. The solution file (.sln) basically describes the bigger picture in XML format; for my present projects it does little more then reference the project files (.vcproj) that make up the solutions. The project files are also in XML, ‘‘. It defines the various details, essentially what you get in the IDEs configuration manager for a specific project, and the files in the solution explorer. I was very happy to see Visual C++ using XML files, because it means I can *read* the things before opening them with an IDE.

Since the files are XML, and the format is pretty obvious: one can modify the project file quiet easily, and adding/subtracting things like source files, include directories, and libraries is a trivial task. If it wasn’t for the use of ProjectGUID’s I might never need to run the IDE again :-/. Who knows, maybe I won’t even need that in a while lol.

Compiler errors: the art of reading Geek and laughing at your typos

The code, “typo”

RenderManager RManager;

The resulting compiler error

1>main.cpp
1>.Sourcemain.cpp(9) : error C2146: syntax error : missing ';' before identifier 'RManager'
1>.Sourcemain.cpp(9) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>.Sourcemain.cpp(9) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

The correction

#include "RenderManager.hpp"

RenderManager RManager;

What makes me laugh: syntax error : missing ‘;’ before identifier.

The good thing: “missing type specifier – int assumed” actually hints that RenderManager is not yet a known type, as in I forgot to include the appropriate header… hehe.

notes 4 later today

http://www.extremetech.com/article2/0,2845,11502,00.asp

http://www.extremetech.com/article2/0,2845,9722,00.asp

http://msdn.microsoft.com/en-us/library/bb174597(VS.85).aspx

http://msdn.microsoft.com/en-us/library/bb173249(VS.85).aspx

Is it just me or…

/* from Tutorial 2, Direct3D 9; DirectX SDK */
if( FAILED( g_pd3dDevice->CreateVertexBuffer( 3*sizeof(CUSTOMVERTEX),
0 /*Usage*/, D3DFVF_CUSTOMVERTEX, D3DPOOL_DEFAULT, &g_pVB, NULL ) ) )
return E_FAIL;

The tutorial describes the arguments, stating that ‘The final parameter is the address of the vertex buffer to create.’ Ok, I think it is obvious that it means the address of the vertex buffer being passed; further more the API documentation says the final argument is “Reserved. Set this parameter to NULL. This parameter can be used in Direct3D 9 for Windows Vista to share resources”.

I can’t help but chuckle a little bit at the tutorial, maybe it is just me and my brains crazy English parser lol.

Wow it’s been a wildly long day!

Fell asleep on the couch last night, so I couldn’t get to sleep early (nodded off after 0300Q), woke up around 0600Q and decided that was just TOOOOO early even for me! The doctors appointment was for 0945 and we had to be in the office NLT 0915, so I’ve been awake since around 0830.

The doctor was very kind and seems to know what he’s doing quite well; personally I like people with experience ;). He examined the toe during the usual questioning. He removed the lump of dead tissue with an angled scissors, something I had to previously convince my mother that it wouldn’t be a good idea to do at home with a table scissors. For better or worse it actually was more painful for him to get the thing in position, then cutting it away; and at least I can say, I have nice red blood lol. The Dr. then decided to put a small piece of cardboard underneath the (clipped) nail to keep it away from the injured side, leading to it falling out when he tried wrapping it in medical tape 8+). He proscribed some antibiotics, *not* slamming the damn thing anymore (haha!), plus the usual cleaning and bandaging. I’ve also instructions to pry up the nail several times a day to keep it from damaging anything, really not sure what is worse: that I have to do such a thing or that doing it doesn’t bother me in the least. The nurse was also kind enough to “pad it well” just in case, when she dressed the wound. There was errands to run afterwards and the pharmacy tor drop by, so needless to say it wouldn’t have helped to crack it apart *again*.

Got it filled and picked up some stuff while waiting on the pharmacist; dressings, tape, etc. Since by then the bill was starting to add up, I told ma if she would cover the proscription, I would pick up the tab on the other supplies; I also snatched a small pound cake on sale for like $2 before we left the store. Hey, if I’m spending money, may as well buy something to gnosh on too!

I’ve spent the rest of the day largely trying to NOT slam this freaking toe into anything else, and playing a lot of SWAT 4. It’s nice to see Rct Cara progressing well; think I owe Duke even more gratitude, for what he accomplished with [SAS] “SWAT day 2009”. I’ve been playing a lot of SWAT 4 lately, between my own operations and watching over the Trps/Rcts. At night sometimes I pop in and join the night crew (mostly fellow Americans and Canadians) for some games on our Raven Shield servers. But really, RvS has been pissing me off a lot with the bugs lately. SWAT 4 is as buggy as RvS, yeah… but at least most of the bugs are not combat critical in SWAT 4 o/.

During my break times and tonight also, I’ve been studying more bits of the DirectX Software Development Kit (SDK). So far DirectX itself seems to be an alright way of getting things done. I can’t stand the ridiculous influnces of Hungarian notation that permeates so many aspects of Windows programming interfaces… the concept is sound but the implemetations I commonly see in code, is just a load of bollocks. Naming identifier well and placing good information in them is a tricky thing at times (gets better with experience) but encoding type data in it, oy. The most useful of which I can think of is adding a ‘p’ in front for each level of *pointing used in a C app (or comparable). In one of the DX samples when I saw a variable named something like pbNoFurtherProcessing or something similiar, I nearly fainted from the stupidity of it all. The pb tells you it’s a pointer to a boolean (bool * in C++), by the time you see it’s being used with the arrow operator (->) and bears an obviously boolean name, that kind of makes it useless information. Not to mention anyone with a *decent* code editor for the last 20+ years can just make a quick jump and look up the variables type if they totally forget it – which shouldn’t happen often.

I’ve also been abusing Visual C++ Express 2008 into cooperating. Right now I have it setup, basically to just be a project and build manager – all the actual code editing is being done in Vi IMproved. MSVC/VS/etc are very very good Integrated Development Environments (IDEs) and I would recommend them to anyone who wants an IDE for serious Windows development (along with a cat scan). However I am used to having UNIX as my IDE, which means powerful tools ;). With more time off work I could probably get vim semi-integrated with the IDE via the +clientserver feature in vim and maybe a plugin of some sort. Non essential though, since right now all the IDE is helping me with is not having to hand-write a makefile for nmake, which would probably have been less trouble then using the IDEs concept of solutions and projects lol.

Life’s been good to day.

Yet another reason for this geek to avoid development for Windows

Since it’s the closest point of interest in the DirectX SDKs samples, I set out to build the most basic one. In order to build the EmptyProject sample in Visual C++ 2008 Express Edition, I’ve had to open the VS Project file for it in the IDE, tell it where to find the DirectX include and library directories, using a modeless dialog that can’t even be resized! Then I have had to tell it where to find headers from another Sample entry it lists in a child node, which can’t find the DirectX include directory specified in the top level project… Since I can’t just right click the child node and modify it the same way as the parent node, I saved the solution and dug up the childs .vsproj.

Looking at the same stupid dialog, I notice that while the last time around I had to go to “Resources -> General” to specify an additional include directory for the pre-processor (which for some brain damaged reason wasn’t under “C/C++ -> Preprocessor”), there was no Resources entry in the tree.

At this point, I just said, “FUCK YOU!”, went back to the original project file. Went to “C/C++ -> Command Line” entry in the configuration, and manually added the /I”path” switch to find the included directory. Then I did like wise under the “Linker -> Command Line” section to manually add the /LIBPATH:”path” switch with the path to the required .lib files. Saved the solution and built the project. Guess what? Doing it that way: EVERYTHING WORKED!!! Ok, it is widely known to be an ultra-standard need, that you’ve got to tell your build system where to find things, yeah that’s right—but you would think samples included with an SDK would pull in parts of the SDK.

Maybe I am just an old man at heart but somehow, I find it interesting that in 2009, it is still faster to just use a Command Line style interfaces then many Graphical User interfaces o/. Come on, it’s only been about 35~40 years since the GUI was invented, and GUIs really took off during the late 1980s. It still makes me crawl… that they still suck just as bad as they did in 1990. Even worse, aside from the mouse on everyones desktop now’re days, beyond the obvious increases in eye candy in the 2000s, I don’t see much usability changes in GUI software, that were not in Mac OS and Windows back in the 1980s. System 1 and Windows 1.0 were especially ugly compared to Windows XP and OS X, and things like Vista and KDE4.3 are very sexy, but heck, what’s really changed since the old days?

I could almost swear, there has not been one serious improvement under Windows, since adding overlapping windows in ’87ish

You know you’ve been programming to long when ….

you can miss-read “You don’t know whether they’re laid out from left to right or right to left in memory”, as “You don’t know whether they’ve been laid …”, and then can’t stop laughing lol.

O.K. I think I have seriously been sitting in front of a computer wwaaaaayyyy too long for one night…….