Categories
C++

C++ – Why make the constructor Explicit

The compiler is allowed to make one implicit conversion to resolve the parameters to a function. What this means is that the compiler can use constructors callable with a single parameter to convert from one type to another in order to get the right type for a parameter. Here’s an example class with a constructor that can […]

Categories
Web Applications

YouTube – Create a new channel

You can create a new YouTube channel from https://www.youtube.com/channel_switcher  

Categories
C++

C++ in-class initialization

The two code snippets you posted are not quite equal. class Something { int m_a = 0; }; Here you specify the value with which to initialize, i.e. 0, at compile time. class Something { int m_a; Something(int p_a); }; Something::Something(int p_a):m_a(p_a){ … }; And here you do it at run time (or possibly at run time), with […]

Categories
Dekstop IDEs

Visual Studio – Working with Code

Alt+Enter or Ctrl+. for generating functions for example for declaration F12 go to definition Ctrl+K+O switch between header and source Ctrl+Space autocomplete Ctrl+- go back Ctrl+Shift+- go forward Ctrl+D duplicate line Shift+Del delete line and place it in the clipboard Ctrl+Shift+V clipboard with clipboard history in VS Alt+Up or Down move a code line

Categories
Web Applications

Clean Google Contacts without a Phone number

Recently I wanted to clean my Google Contacts who don’t have a phone because I had like 15 000 Contacts with only an e-mail It actually was not so intuitive, here is my process On your PC Open Google Contacts and Export all your contacts into a .cvs file Import this file in Google Sheets […]

Categories
Dekstop IDEs

Visual Studio Back and forth

Use the Ctrl+Shift+- to move forward Ctrl+- to move back.

Categories
Game Development

libSDL – Drawing a BMP Image

#include <iostream> #include <SDL.h> const int WIDTH = 640, HEIGHT = 360; int main(int argc, char* argv[]) { SDL_Surface* imageSurface = NULL; SDL_Surface* windowSurface = NULL; if (SDL_Init(SDL_INIT_EVERYTHING) < 0) { std::cout << “SDL could not initialize! SDL Error: ” << SDL_GetError() << std::endl; } SDL_Window* window = SDL_CreateWindow(“Hello SDL World”, SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, WIDTH, HEIGHT, […]

Categories
Game Development

libSDL – Hello World

#include <iostream> #include <SDL.h> const int WIDTH = 800, HEIGHT = 600; int main(int argc, char* argv[]) { SDL_Init(SDL_INIT_EVERYTHING); SDL_Window* window = SDL_CreateWindow(“Hello SDL World”, SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, WIDTH, HEIGHT, SDL_WINDOW_ALLOW_HIGHDPI); // Check that the window was successfully created if (NULL == window) { // In the case that the window could not be made… std::cout […]

Categories
Game Development

Simplest libSDL example

Simplest libSDL example #include <iostream> #include <SDL.h> int main(int argc, char* argv[]) { if (SDL_Init(SDL_INIT_EVERYTHING) < 0) { std::cout << “SDL could not initialise! SDL Error: ” << SDL_GetError() << std::endl; } return EXIT_SUCCESS; } See https://dangeorgiev.com/add-include-directories-and-libraries-to-visual-studio/  

Categories
Dekstop IDEs

Add Include Directories and Libraries to Visual Studio

To add Include paths and Libraries     To Link the Library This will fix these errors Copy DLL Files Add XCOPY “$(SolutionDir)SDL2-2.0.12\lib\x86\*.DLL” “$(TargetDir)” /D /K /Y To