Wednesday, 7 May 2014

Custom Build Tools in Visual Studio

Custom Build Tools in Visual Studio

You can compile non-standard file types with arbitrary programs in Visual studio by specifying a Custom Build Tool. But often the tool expects to be running in the same directory as the target file, and it won't be, it will be running in the Project directory. And multiline batch commands are not allowed in Visual Studio 2012.

So we use the START batch command to specify the directory with /D, followed by the exe and its parameters:

START "title" /D"%(RootDir)%(Directory)" "win_flex.exe" "%(FullPath)"

Property Sheets in Visual Studio are super-important.

If you are making a lot of projects in Visual Studio and having to set up a lot of project options, you need Property Sheets. Go to the Property Manager window, and you can create .props files here that whole projects or individual configurations can inherit from.

http://msdn.microsoft.com/en-US/library/z1f703z5(v=vs.80).aspxhttp://stackoverflow.com/questions/17754038/visual-studio-express-2012-properties-of-property-sheet-trouble

Sunday, 4 May 2014

Effect groups - grouping techniques in DirectX 11 Effects

See http://msdn.microsoft.com/en-us/library/windows/desktop/ff476120.aspx for details, but in general, in .fx:

fxgroup Group1
{
     technique11 Tech1 { ... }
     technique11 Tech2 { ... }
}
and in C++:
pEffect->GetTechniqueByName( "Group1|Tech2" );
or
pEffect->GetGroupByName("Group1")->GetTechniqueByName( "Tech1" );

Thursday, 1 May 2014

Unity - making sure changes to a ScriptableObject are saved

After reimporting or changing a ScriptableObject-derived asset, call EditorUtility.SetDirty(obj) on the object and its .asset file will be saved.

Tuesday, 29 April 2014

Visualizing the contents of QExplicitlySharedDataPointer or QSharedDataPointer in Visual Studio 2012 for Qt5

The path "C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\Packages\Debugger\Visualizers" contains qt5.natvis, which performs the role that autoexp.dat once did in previous versions of Visual Studio.

The following lines stomp on your QSharedData-derived classes and prevent showing their own data in the debugger:

    <Type Name="QSharedData">
        <Expand>
            <Item Name="[referenced]">ref._q_value</Item>
        </Expand>
    </Type>

So delete them and you'll be able to see what a QExplicitlySharedDataPointer<> actually points to!

Friday, 25 April 2014

WINVER values

Version WINVER
Windows 8.1 _WIN32_WINNT_WINBLUE (0x0602)
Windows 8 _WIN32_WINNT_WIN8 (0x0602)
Windows 7 _WIN32_WINNT_WIN7 (0x0601)
Windows Server 2008 _WIN32_WINNT_WS08 (0x0600)
Windows Vista _WIN32_WINNT_VISTA (0x0600)
Windows Server 2003 with SP1, Windows XP with SP2 _WIN32_WINNT_WS03 (0x0502)
Windows Server 2003, Windows XP _WIN32_WINNT_WINXP (0x0501)