All Blog Entries

All blog entries, ordered from most recent. Entry count: 1198.

Warning! Some information on this page is older than 6 years now. I keep it for reference, but it probably doesn't reflect my current knowledge and beliefs.

Pages: > 1 ... 31 32 33 34 35 ... 150 >

# Smart Pointers in C++11 - My Article in ProgramistaMag

Mon
05
Aug 2013

In new issue 7/2013 (14) of Programista magazine there is my next article (in Polish) - "Inteligentne wskaźniki w C++11" (Smart Pointers in C++11). This is a long one. In this article I introduce the problem of manual memory management in C++ along with the concept of object lifetime and the matter of object ownership. I then describe RAII idiom and explain what smart pointer mean. I describe features of smart pointer classes available in C++11 standard library (auto_ptr, unique_ptr, shared_ptr, weak_ptr) and show how to use them with short examples. I also touch some additional topics like writing custom deleters and show source code of custom implementation of a simple smart pointer.

You can find the magazine e.g. in Empik stores, as well as subscribe for electronic or paper version.

Comments | #c++ #productions Share

# About Demoscene - My Article in ProgramistaMag

Wed
03
Jul 2013

In the latest issue of Programista 6/2013 (13) magazine, there is my second article: "About Demoscene" (in Polish). This time it is less technical, so it should be understandable to everyone, regardless of known programming languages. I might not be the best person to write about demoscene, but I did my best to gather my experiences, research and describe different aspects of this phenomenon - from history and the beginnings at the time when 8-bit and 16-bit computers were used, through the explanation of what demoscene and a demo really is, how demoparty looks like, few words about competitions, until some details about different kinds of productions (demos for retro platforms, modern demos, intros) and how are they made.

Besides my article, on 140 pages if this issue, you will find many interesting articles about programming from assembler to C#. I encourage to find the magazine in Empik store or subscribe it online.

Comments | #demoscene #productions Share

# Floating-Point Formats Cheatsheet

Thu
13
Jun 2013

Floating-point numbers (or floats in short) are not as simple as integer numbers. There is much to be understood when dealing with these numbers on low level - basic things like the sign + exponent + significand representation (and that exponent is biased, while significand has implicit leading 1), why you should never compare calculation results operator ==, that some fractions with finite decimal representation cannot be represented exactly in binary etc., as well as why there are two zeros -0 and +1, what are infinite, NaN (Not a Number) and denorm (denormal numbers) and how they behave. I won't describe it here. It's not an arcane knowledge - you can find many information about this on the Web, starting from Wikipedia article.

But after you understand these concepts, quantitative questions come to mind, like: how many significant decimal digits can we expect from precision of particular float representation (half, single, double)? What is the minimum non-zero value representable in that format? What range of integers can we represent exactly? What is the maximum value? And finally: if our game crashes with "Access violation, reading location 0x3f800000", what chances are that we mistaken pointer for a float number, as this is one of common values, meaning 1.0?

So to organize such knowledge, I created a "Floating-Point Formats" cheatsheet:

Floats_cheatsheet.pdf
Floats_cheatsheet.docx

Comments | #productions #math Share

# WeCan 2013 Demoparty

Sun
12
May 2013

They announced date and details of 2013 edition of WeCan demoparty. The website is www.we-can.pl. There is also WeCan 2013 Facebook Event. The party will take place 20-22 September in Łódź, Poland, in "Broadway 18" club. It is a multiplatform demoscene party. Next to traditional compos in different categories (like PC demo, intro and others) with valuable awards funded by sponsors (including NVIDIA and ARM), talks and electronic music concerts, this time they are going to organize additional competitions: "36h code jam" about game development and "real-time coding competition" about writing shader effects. I'm sure it will be great event and I hope to see you there :)

Comments | #demoscene #events Share

# Writing Efficient C++ Code - my Article in ProgramistaMag

Sat
27
Apr 2013

I started cooperation with Programista - Polish magazine for programmers and other IT professionals. You can find my first article in the latest issue 4/2013 (11).

My article - "Writing Efficient C++ Code" - is about achieving best possible efficiency of native C++ code. It describes data-oriented design as an alternative to pure object-oriented philosophy and shows its advantages, mostly related to consciously designed layout of data in memory, which makes good use of CPU cache. It also mentions operations that should be avoided if code is to be efficient, shows some language tricks and Visual C++ project options that help with generating efficient code and mentions parallelization.

Besides, in each issue of the magazine you can find interesting articles about different programming languages, libraries and technologies, as well as interviews, book reviews and other articles related to software development. The magazine is available for subscription in electronic and paper form.

Comments | #c++ #optimization #productions Share

# Type Visualization in Visual Studio 2012 Debugger

Tue
23
Apr 2013

When you code in C++ and you have your own library of data types, especially containers, it would be nice to be able to see it in the debugger formatted in some readable way. In Visual C++/Visual Studio, there used to be a special file autoexp.dat designed for this purpose, as described in "Writing custom visualizers for Visual Studio 2005". But it had weird syntax and poor error reporting.

Now in Visual Studio 2012 there is a new way of defining debugger visualizations for native data types, called Native Type Visualization Framework (natvis). All you need to do is to create an XML file with ".natvis" extension following special format and place it in directory: %USERPROFILE%\Documents\Visual Studio 2012\Visualizers. Full documentation of this format is on this single MSDN page: "Creating custom views of native objects in the debugger". See also "Expressions in Native C++" and "Format Specifiers in C++".

For example, if you have a singly linked list:

template<typename T>
class CLinkedList {
   // ...
    struct CNode {
       T Value;
       CNode* Next;
    };
    size_t Count;
    CNode* Head;
};

Default visualization of a 3-element object in the debugger would look like this:

But if you create following natvis file:

<?xml version="1.0" encoding="utf-8"?>
<AutoVisualizer xmlns="http://schemas.microsoft.com/vstudio/debugger/natvis/2010">
   <Type Name="CLinkedList&lt;*&gt;">
       <DisplayString>{{Count = {Count}}}</DisplayString>
       <Expand>
           <Item Name="[Count]">Count</Item>
           <LinkedListItems>
               <Size>Count</Size>
               <HeadPointer>Head</HeadPointer>
               <NextPointer>Next</NextPointer>
               <ValueNode>Value</ValueNode>
           </LinkedListItems>
       </Expand>
   </Type>
</AutoVisualizer>

Next time you start debugging (restarting Visual Studio is not required), same object will be shown as:

Besides extracting single fields from objects, evaluating whole C++ expressions and formatting values into a string for summary of whole object, this framework is able to visualize following data structures:

Comments | #visual studio #debugger #c++ Share

# IGK 2013 Quiz

Tue
16
Apr 2013

During IGK 2013 gamedev conference, just like in previous years, we organized a contest with 75 questions in 15 categories, from gaming to programming. We had 8 participants this year and the winner was Artur Poznański "artpoz" - congratulations! See full results.

You can now download new version of the application with source code in C# and this year's questions to test your gamedev knowledge by yourself or with your friends:

IGK_Quiz_2013.zip (2.76 MB)

Comments | #warsztat #igk #competitions #productions #events Share

# Here be Dragons - Our Game from IGK 2013 Compo

Sat
13
Apr 2013

During IGK 2013 gamedev conference there was traditional game development compo, where teams of up to 4 people have to make a game in about 8 hours. Of course we participated in it. This time we called our team "Mass Deffect" (just some random name). There were four of us, all programmers: Kamil Szatkowski "Netrix", Karol Kuczmarski "Xion", Krzysztof Kluczek "Krzysiek K.", and me.

The theme this year, with all the requested features of the game, was: "Artiller game - multiple ways of destroying map, hp & mp - at least 2 kinds of energies - achievements - multiplayer" That fitted into my plan to use two mice on one computer, which I researched recently and described in: Handling Multiple Mice with Raw Input. We designed our game in the Saturday evening, after considering multiple ideas. Finally we chose Krzysiek's idea inspired by Rampart - an old Atari game (see this video).

Our game has title "Here be Dragons". In works on PC, Windows. It is written in Visual C++ 2010 Express, based on a Direct3D 9 framework developed by Krzysiek K. We decided to use 3D graphics (which becomes more and more rare on this kind of game development compos). But game logic is 2D and map entirely fits the screen. Two players build castles on the opposite sides of the map (with left mouse button). On the large enough castle, towers with maidens appear which are resource needed by dragons :) When player has dragons, he can shoot fireballs at the enemy (with right mouse button).

We took 4th place out of 12. Our game lacks many planned features. It doesn't even have sound or music. Anyway, it was fun as always :) Here you can download the game with full source code:

HereBeDragons.7z (3.17 MB)

Comments | #events #productions #competitions #igk #warsztat Share

Pages: > 1 ... 31 32 33 34 35 ... 150 >

[Download] [Dropbox] [pub] [Mirror] [Privacy policy]
Copyright © 2004-2026