background preloader

Game Programming Patterns

Game Programming Patterns

Which Custom Web Fonts Solution Should You Use? Over the past few years the number of fonts available for use in web design has dramatically increased. It wasn’t long ago that we all knew not to stray further than the basic Arial, Helvetica, Times, Georgia mix, but now there’s a range of services that allow the use of almost any font imaginable in your website design. This post rounds up the various custom web font solutions and looks at the pros and cons of each. The most basic solution out of the lot is the CSS3 @font-face property. I’m sure we’re all familiar with @font-face by now, it allows you to load a font file from your CSS and apply that font to the styling of your HTML text. Pros: Powered by CSS. Cons: Limited to open source fonts Links: Since Google launched its Google Web Fonts API the service has grown to include hundreds of freely available fonts for use in your designs. Powered by CSS. Choice is limited to a range of free fonts Premium service with a yearly fee

Game Development: Tips & Tricks Google C++ Style Guide Definition: Streams are a replacement for printf() and scanf(). Pros: With streams, you do not need to know the type of the object you are printing. You do not have problems with format strings not matching the argument list. Cons: Streams make it difficult to do functionality like pread(). Decision: Do not use streams, except where required by a logging interface. There are various pros and cons to using streams, but in this case, as in many other cases, consistency trumps the debate. Extended Discussion There has been debate on this issue, so this explains the reasoning in greater depth. Proponents of streams have argued that streams are the obvious choice of the two, but the issue is not actually so clear. cout << this; // Prints the address cout << *this; // Prints the contents The compiler does not generate an error because << has been overloaded. Some say printf formatting is ugly and hard to read, but streams are often no better.

W3Schools Online Web Tutorials Baby's First Garbage Collector – journal.stuffwithstuff.com December 08, 2013 — c, code, language When I get stressed out and have too much to do, I have this paradoxical reaction where I escape from that by coming up with another thing to do. Usually it’s a tiny self-contained program that I can write and finish. The other morning, I was freaking myself out about the book I’m working on and the stuff I have to do at work and a talk I’m preparing for Strange Loop, and all of the sudden, I thought, “I should write a garbage collector.” Garbage collection is considered one of the more shark-infested waters of programming, but in this post, I’ll give you a nice kiddie pool to paddle around in. Reduce, reuse, recycle The basic idea behind garbage collection is that the language (for the most part) appears to have access to infinite memory. Of course, machines don’t have infinite memory. “Garbage” in this context means memory it previously allocated that is no longer being used. The second rule is the recursive one. Marking and sweeping That’s it. Simple

10 Easy Steps to a Complete Understanding of SQL Too many programmers think SQL is a bit of a beast. It is one of the few declarative languages out there, and as such, behaves in an entirely different way from imperative, object-oriented, or even functional languages (although, some say that SQL is also somewhat functional). I'm writing SQL every day and embracing SQL with my Open Source Software jOOQ. readers who have already worked with SQL but never completely understood itreaders who know SQL well but have never really thought about its syntaxreaders who want to teach SQL to others This tutorial will focus on SELECT statements only. 1. Get this into your head first. SELECT first_name, last_name FROM employees WHERE salary > 100000 Easy to understand. What do we learn from this? So if this is so simple, what's the problem? Forget about all that. 2. A common source of confusion is the simple fact that SQL syntax elements are not ordered in the way they are executed. For simplicity, not all SQL clauses are listed. 3. FROM a, b 4. 5. 6.

Online Learning: A Bachelor's Level Computer Science Program Curriculum (Updated) Introduction [Update: See also the follow-up post to this piece, An Intensive Bachelor's Level Computer Science Curriculum Program.] A few months back we took an in-depth look at MIT’s free online Introduction to Computer Science course, and laid out a self-study time table to complete the class within four months, along with a companion post providing learning benchmarks to chart your progress. In the present article, I'll step back and take a much more broad look at com-sci course offerings available for free on the internet, in order to answer a deceptively straightforward question: is it possible to complete the equivalent of a college bachelor’s degree in computer science through college and university courses that are freely available online? The former question is more difficult to answer than it may at first appear. Yet, this does not mean that all the necessary elements for such a curriculum are not freely accessible. Our hypothetical curriculum will simplify this model.

Software optimization resources. C++ and assembly. Windows, Linux, BSD, Mac OS X See also my blog Contents Optimization manuals This series of five manuals describes everything you need to know about optimizing code for x86 and x86-64 family microprocessors, including optimization advices for C++ and assembly language, details about the microarchitecture and instruction timings of most Intel, AMD and VIA processors, and details about different compilers and calling conventions. Operating systems covered: DOS, Windows, Linux, BSD, Mac OS X Intel based, 32 and 64 bits. Note that these manuals are not for beginners. 1. This is an optimization manual for advanced C++ programmers. 2. This is an optimization manual for advanced assembly language programmers and compiler makers. 3. This manual contains details about the internal working of various microprocessors from Intel, AMD and VIA. 4. 5. All five manuals Download all the above manuals together in one zip file. C++ vector class library File name: vectorclass.zip, size: 682404, last modified: 2017-Jul-27.Download.

Guide de survie du positionnement CSS Cet article s'adresse à ceux qui ont déjà quelques notions de positionnement CSS, mais qui se demandent s'ils l'utilisent correctement, ou qui galèrent pour mettre en pratique leurs connaissances encore trop bancales. Comment s'y retrouver dans le machin tentaculaire qu'est le positionnement CSS? C'est un sujet à la fois complet (tant mieux) et complexe (ouille). les possibilités de CSS 2.1 pour l'affichage et le positionnement des éléments (et à l'avenir de CSS 3); celles qui sont implémentées dans les navigateurs (et donc pas les autres, sauf pour préparer l'avenir); les contraintes de mise en page et d'adaptation aux contenus (le contenu, ça va ça vient… et ça vous surprend toujours d'une manière ou d'une autre); les contraintes du média screen (on ne fait pas tout et n'importe quoi avec les hauteurs et largeurs, le centrage, etc.); les bugs éventuels des navigateurs (ou de certains navigateurs). Comment s'y retrouver? Ressources en français sur le positionnement CSS

Что такое скрипты и с чем их едят — Lua & C++ Добрый день, Хабрахабр! Решил написать этот топик на тему скриптов Что нужно знать? С++ на приличном уровне (в уроке будут шаблоны — template)Lua, очень легкий скриптовый язык. Почему писать диалоги игры в .cpp файле было большой ошибкой Если вы разрабатывали большие проекты (к примеру, масштабные игры), замечали, что с каждой новой сотней строк кода компиляция идет медленней? Но есть способ, на голову выше — использование скриптов. Решение проблемы «Окей, для таких дел хватает обычного файла с описанием характеристиков игрока. Об одном таком скриптовом языке Lua пойдет речь. Как это работает? Прежде чем начать, важно понимать, как работает скриптовый язык. Мы в С++-программе делаем какие-либо функции, «регистрируем» их под каким-нибудь именем в скрипте и вызываем в скрипте. UPD: Внимание! template<class t> T MethodName(); На template<class T> T MethodName(); И еще вместо lua_CFunction проскакивает lua_cfunction Спасибо! Я готов! Теперь создаем файл main.cpp, пишем в нем: int main(){ return 0; }

Initializr - Start an HTML5 Boilerplate project in 15 seconds!

Related: