Smooth 2D Noise Viewer
Perlin and Value Noise
Functions | Variables
Main.cpp File Reference

The window procedure WndProc(), and wWinMain(). More...

#include "CMain.h"
#include "resource.h"

Go to the source code of this file.

Functions

LRESULT CALLBACK WndProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
 Window procedure. More...
 
void InitWindow (HINSTANCE hInst, INT nShow, WNDPROC WndProc)
 
int WINAPI wWinMain (HINSTANCE hInst, HINSTANCE hPrev, LPWSTR lpStr, int nShow)
 Winmain.
More...
 

Variables

static CMaing_pMain = nullptr
 Pointer to the main class. More...
 
static const int g_nWidth = 600
 Client area width in pixels. More...
 
static const int g_nHeight = 600
 Client area height in pixels. More...
 

Function Documentation

◆ InitWindow()

void InitWindow ( HINSTANCE  hInst,
INT  nShow,
WNDPROC  WndProc 
)

Create and initialize a window.

Parameters
hInstInstance handle.
nShow1 to show window, 0 to hide.
WndProcWindow procedure.

Definition at line 253 of file Main.cpp.

◆ WndProc()

LRESULT CALLBACK WndProc ( HWND  hWnd,
UINT  message,
WPARAM  wParam,
LPARAM  lParam 
)

This is the handler for messages from the operating system.

Parameters
hWndWindow handle.
messageMessage code.
wParamParameter for message.
lParamSecond parameter for message if needed.
Returns
0 If message is handled.

Definition at line 43 of file Main.cpp.

◆ wWinMain()

int WINAPI wWinMain ( HINSTANCE  hInst,
HINSTANCE  hPrev,
LPWSTR  lpStr,
int  nShow 
)

Initialize a window and start the message pump.

Parameters
hInstHandle to the current instance.
hPrevUnused.
lpStrUnused.
nShowNonzero if window is to be shown.
Returns
0 If this application terminates correctly, otherwise an error code.

Definition at line 297 of file Main.cpp.

Variable Documentation

◆ g_nHeight

const int g_nHeight = 600
static

Definition at line 32 of file Main.cpp.

◆ g_nWidth

const int g_nWidth = 600
static

Definition at line 31 of file Main.cpp.

◆ g_pMain

CMain* g_pMain = nullptr
static

Definition at line 29 of file Main.cpp.