Tag: libraries

Entries for tag "libraries", ordered from most recent. Entry count: 31.

Uwaga! Informacje na tej stronie mają ponad 5 lat. Nadal je udostępniam, ale prawdopodobnie nie odzwierciedlają one mojej aktualnej wiedzy ani przekonań.

Pages: > 1 2 3 4 >

# Music Analysis - Spectrogram

23:24
Wed
14
Jul 2010

I've started learning about sound analysis. I have some deficiencies in education when it comes to digital signal processing (greetings for the professor who taught this subject at our university ;) but Wikipedia comes to the rescue. As a starting point, here is a spectrogram I've made from one of my recent favourite songs: Sarge Devant feat. Emma Hewitt - Take Me With You.

Now I'm going to exaplain in details how I've done this by showing some C++ code. First I had to figure out how to decode an MP3, OGG or other compressed sound format. FMOD is my favourite sound library and I knew it can play many file formats. It took me some time though to find functions for fast decoding uncompressed PCM data from a song without actually playing it for all 3 minutes. I've found on the FMOD forum that Sound::seekData and Sound::readData can do the job. Finally I've finished with this code (all code shown here is stripped from error checking which I actually do everywhere):

Read full entry > | Comments | #math #libraries #music #rendering #dsp #algorithms Share

# Smarty Cheatsheet

20:16
Fri
04
Jun 2010

I knew about this before, but today I've found some time to deeply study Smarty - a free template engine for PHP. Templates in webdev (not to confuse with templates in C++) look like an interesting concept, because they separate PHP code from HTML code. I wish I used them from the start during coding my homepage and the www.gamedev.pl website instead of print()-ing HTML tags directly...

Anyway, I've written a small Smarty Cheatseet. Of course it makes sense only after studying the original library documentation, it cannot replace it.

By the way, I was also looking for some PHP library for creating RSS or ATOM feeds and I've found Feedcreator. Now I'm going to make something useful with it...

NEW: This "something" is an RSS feed for newest screenshots uploaded into www.gamedev.pl website: Feed Warsztat - Screeny, as well as for projects: Feed Warsztat - Projekty.

Comments | #webdev #php #libraries Share

# Some Thoughts about Library Design

19:58
Sun
16
May 2010

Much has been said about designing good user interface, whether for desktop applications, websites or games. There are whole books available about GUI design and even this year's IGK-7'2010 conference featured two lectures about the interface in games. But what about interfaces for programmers?

I can't find much about the rules of good library API design and I believe there is much to say in this subject. I only know The Little Manual of API Design written by Jasmin Blanchette from Trolltech/Nokia, one of the creators of Qt library (thanks for the link Przemek!). There is also a blog entry about Math Library, which is quite interesting. Inspired by it, I've came up with a general thought that you cannot have all the following features when designing a library and its API, you have to choose 2 or 3 of them and make some compromise:

I think some patterns and best practices as well as some anti-patterns could be found when you look at interfaces of many libraries. Maybe I'll post some more of my thoughts on this subject in the future. In the meantime, do you know any other resources about API design?

Comments | #philosophy #software engineering #libraries Share

# LZMA SDK - How to Use

19:37
Sat
08
May 2010

What do you think about when I tell a word "compression"? If you currently study computer science, you probably think about some details of algorithms like RLE, Huffman coding or Burrows-Wheeler transform. If not, then you surely associate compression with archive file formats such as ZIP and RAR. But there is something in between - a kind of libraries that let you compress some data - implement a compression algorithm but do not provide ready file format to pack multiple files and directories into one archive. Such library is useful in gamedev for creating VFS (Virtual File System). Probably the most popular one is zlib - a free C library that implements Deflate algorithm. I've recently discovered another one - LZMA. Its SDK is also free (public domain) and the basic version is a small C library (C++, C# and Java API-s are also available, as well as some additional tools). The library uses LZMA algorithm (Lempel–Ziv–Markov chain algorithm, same as in 7z archive format), which has better compression ratio than Deflate AFAIK. So I've decided to start using it. Here is what I've learned:

If you decide to use only the C API, it's enough to add some C and H files to your project - the ones from LZMASDK\C directory (without subdirectories). Alternatively you can compile them as a static library.

There is a little bit of theory behind the LZMA SDK API. First, the term props means a 5-byte header where the library stores some settings. It must be saved with compressed data to be given to the library before decompression.

Next, the dictionary size. It is the size of a temporary memory block used during compression and decompression. Dictionary size can be set during compression and is then saved inside props. Library uses dictionary of same size during decompression. Default dictionary size is 16 MB so IMHO it's worth changing, especially as I haven't noticed any meaninful drop in compression rate when set it to 64 KB.

And finally, end mark can be saved at the end of compressed data. You can use it so decompression code can determine the end of data. Alternatively you can decide not to use the end mark, but you must remember the exact size of uncompressed data somewhere. I prefer the second method, because remembering data size takes only 4 bytes (for the 4 GB limit) and can be useful anyway, while compressed data finished with end mark are about 6 bytes longer than without it.

Compressing full block of data with single call is simple. You can find appropriate functions in LzmaLib.h header. Here is how you can compress a vector of bytes using LzmaCompress function:

Read full entry > | Comments | #commonlib #libraries #algorithms Share

# My Impressions about SQLite

20:06
Tue
20
Apr 2010

SQLite is a very strange library. It's a database engine that can store lots of data in a relational database and exposes API based on SQL language. On the other hand though, it's not a huge application that has to be installed in the system, work in the background and you have to connect to it via network interface, like MySQL or PostreSQL do. It's actually a lightweight library written in C that can be linked with your program and uses specified file as the database. It's fascinating that such a small library (there is even a preprocessed source version as a single 3.75 megabyte C file!) supports much of the SQL language.

The API of the SQLite library is similar to any other SQL-based database access API for any programming language. I've played with it a bit and here is my small sample code:

#include <sqlite3.h>

int main()
{
  sqlite3 *db;
  sqlite3_open_v2("D:\\tmp\\test.db", &db,
    SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, NULL);

  sqlite3_exec(db, "begin", NULL, NULL, NULL);
  
  sqlite3_stmt *stmt;
  sqlite3_prepare_v2(db, "insert into table1 (id) values (?)",
    -1, &stmt, NULL);

  for (int i = 0; i < 10; i++)
  {
    sqlite3_reset(stmt);
    sqlite3_bind_int(stmt, 1, i);
    sqlite3_step(stmt);
  }

  sqlite3_exec(db, "commit", NULL, NULL, NULL);

  sqlite3_finalize(stmt);

  sqlite3_close(db);
}

It's hard for me to think of any application for such a strange library. It offers too much when you just want to design your file format and too few if you need a fully-featured database, like for a web server. So why did I decide to get to know this library? It's all because of an interesting gamedev tool called Echo Chamber. It's a free data mining program that can visualize data from SQLite database files as many different kinds of plots, even 3D ones. So when you integrate logging some numeric data from your engine into an SQLite database you can easily do performance analysis with it.

Comments | #tools #libraries #sql Share

# Releasing CommonLib 9.0

21:29
Wed
16
Dec 2009

After 13 months since previous release, today I want to share all who may be interested the new version of my CommonLib 9.0. As a reminder, it is a universal library for C++, created especially with game programmers in mind. I share it under GNU LGPL license hoping that at least some pieces of this code can be useful. Important links:

The new version contains massive amount of my recent code which proved to be useful to me and have been tested in my home projects. Among all these changes, bigger ones are:

For more information, see What's New in Version 9.0.

Comments | #libraries #productions Share

# Learning PhysX

19:52
Fri
18
Sep 2009

Yesterday I've started learning NVIDIA PhysX. It's the first time I use a physics engine at home, but it seems quite easy for me. I like the PhysX library as it has pretty, object-oriented API.

Is using a physics engine really an advanced topic? Now I don't think so. Sure there are some scary looking terms like "inertia tensor" or "angular damping", but all you need for the start is to know a bit about vectors, matrices, quaternions and some school-level physics like the concept of mass, velocity and force.

PhysX is very powerful. It can simulate soft bodies, cloth, force fields, fluids and much more. But the foundation is just rigid body physics plus character controller. In fact it is so simple and powerful at the same time that I now think every beginner game programmer should learn this. Physics in games is not only to simulate boxes and ragdolls of killed enemies. Using such physics engine is many times easier than implementing algorithms for normal collision detection, sliding along walls, walking on the height field, checking if an object entered a trigger or casting rays. PhysX offers it all!

So how to start learning PhysX if you are interested in this subject? All you need to do is to go to the NVIDIA PhysX website, download and install the PhysX SDK. It includes all necessary files like headers, libraries, DLL-s, documentation and tutorials. I learn from the included tutorials in DOC format which can be found in the TrainingPrograms\Docs\ subdirectory.

Here is a small screenshots from my today experiments:

Comments | #libraries #physics Share

# MFC i Smart PropertyGrid

16:43
Sat
06
Jun 2009

Używam w pracy MFC i powiem wam, że wbrew temu co się mówi (i co wcześniej powtarzałem za innymi), to wcale nie jest taka zła biblioteka. Ta dostępna w płatnych wersjach Visual C++ biblioteka do GUI to tak naprawdę cienka, obiektowa nakładka na WinAPI. Tak więc ma swoje klasy odpowiadające m.in. różnym kontrolkom interfejsu, obiektom GDI itp., ale z zestawów flag bitowych czy też zasobów z zaprojektowanymi graficznie okienkami korzysta już z tych samych, co czyste WinAPI. Nie oferuje zbyt wiele ponad to, co API systemowe, ale trochę uprzyjemnia pracę. Jeśli ktoś zna dobrze WinAPI, to nie ma kłopotów z opanowaniem MFC ani powodów do narzekań, chyba że co najwyżej na to, że biblioteka jest tym czym jest i niczym więcej.

Szukałem wczoraj rozwiązania kwestii kontrolki Property Grid dla MFC i znalazłem bibliotekę Smart PropertyGrid.MFC firmy Visualhint. Jest świetna - ładna, potężna, rozszerzalna, a dzięki dobrze zaprojektowanemu interfejsowi opartemu na wielu klasach i koncepcji iteratorów, także wygodna w użyciu. Twórcy udostępnili ją całkowicie za darmo, bo teraz rozwijają i sprzedają wersję tej kontrolki dla .NET (choć przecież platforma .NET ma taką kontrolkę w standardzie).

Smart PropertyGrid.MFC

Comments | #c++ #gui #libraries #winapi #visual studio Share

Pages: > 1 2 3 4 >

STAT NO AD
[Stat] [STAT NO AD] [Download] [Dropbox] [pub] [Mirror] [Privacy policy]
Copyright © 2004-2018