Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 19 Aug 2012
Offline Last Active May 15 2013 04:11 PM

Topics I've Started

drawing in Win32

08 December 2012 - 03:20 AM

Hey everyone,
I'm just having some fun with reinventing many wheels. Posted Image
I just love to understand the low level programming!

So here is what I want to do: basically I want to make my own pixel drawing system.
I want to create a pixel class which stores a color. After I make an array of [640][480] which will be my "screen".
When I gave all pixels a color I want to draw every pixel on the screen.

How can I draw all pixels on the screen? SetPixel is a very slow method so I want to avoid that.
Is it possible to directly connect my pixels to the screen pixels?
How does the GDI communicate with the screen pixels?
How can I communicate with the screen pixels without using the GDI or SetPixel? Is it even possible?

Kind regards,


07 December 2012 - 04:26 AM

When looking at 3D projections and transformations I was thinking on 3Dsmax, which has multiple viewports. So I've tried to get my own viewport with logical units -1 to 1.

Now I wonder if I'm using a modern way of setting up a viewport. I have found these functions on msdn but I have no idea if these are still used nowadays.

  hDC = BeginPaint(hWnd, &ps);
  GetClientRect(hWnd, &client);

  SetViewportOrgEx(hDC, client.right/2, client.bottom/2, 0);
  SetViewportExtEx(hDC, client.right, client.bottom, 0);
  SetWindowOrgEx(hDC, 0, 0 ,0);
  SetWindowExtEx(hDC, 2, 2, 0);

  Rectangle(hDC, 0, 0, 1, 1);
  EndPaint(hWnd, &ps);

This code sets up my window to 2 logical units, from -1 to 1. So like DirectX uses his viewport.
And I've changed the viewport extends so when I scale the window, the objects in the window are scaled also.

3D algorithm

05 December 2012 - 09:33 PM

Hey everyone, has been a while I've programmed but I'm back. Posted Image

I know that re-writing existing code is useless. But I don't mind to re-write some code, I want to learn how it's done.
I want to make a 3D polygon and draw it in C++, without using DirectX or OpenGL.
I've been looking around after source codes or tutorials but haven't found a single tutorial that helps me.

Very simple example of what I want to do:
m_Polygon = new Polygon(vertex1, vertex2, vertex3, vertex4); // where the vertexes have a X,Y,Z

So I want to draw the 3D polygon in my 2D screen. Can someone help me with this. Posted Image

Thank you and kind regards,

Allocation of memory

08 October 2012 - 08:46 AM

Hi everyone!

I'm digging into open source engines to understand their memory management but the more I look in it, the more confused I get.

For example Unigine ( it's a nice engine ) uses different headers for all kind of allocations.
struct FixedChunk;
struct FixedAllocator;
struct HeapChunk;
struct HeapPool;
struct HeapAllocator;
struct SystemAllocator;
struct Allocator;
struct Memory;

Why are they using so many structs(all in different headers)?
An allocator is an allocator so why don't they just write 1 struct: Allocator. and use it for everything.
I don't get it why they uses so many structs. So if someone could explain this for me, thank you!


PC games - profits, discussion

28 September 2012 - 07:21 PM

Hi everyone,

This can bring up some discussions but this needs to be done.

I promote PC games which you can download for free. But in-game you have a possibility to buy items, cool stuff for real money.
A friend of mine promotes PC games which you pay only once. So only 60 dollar and you can have all the content in-game.

My example: Runescape
- You start with a limited amount of items, exploring areas, etc.
- The players can explore all the limited stuff for free, so no charges or no time limit.
- This will cause many players to create an account, not saying they will continue playing.
- You need to attract the players the first 10 minutes of the game. So a nice tutorial or cool graphics.
- When the player gets addicted or feels like exploring everything, he can buy the "full game" starting from a month.

A friend of mine his example: WoW
- You buy the game for 60 dollar.
- You can create an amount of characters
- The player has a great amount of choices what he will be
- You can explore everything, so no limitation from the start.

My kickback is.. You need to buy WoW. And if you want to be very good at PvP's you are like forced to buy items/armor with real money..
There are noob levels that pay their loan just to beat other players... ( I thought he said something like this, I don't play WoW so I don't know anything about it. ) So WoW is a bad example. Posted Image

What are your opinions?
Do you prefer a free game where you can put some money in if you want more? Or do you rather want a only-pay-once game? The Wow games is an excepting on this topic. They are just too awesome so they want to get paid at the start + in-game. Posted Image

If you look at the profits I think a free game with buy-able content in-game will have more profits on a long period.
If you say like 5 dollar / month the player just needs to buy the full version of your game for a year. When you can keep the player entertained/addicted there is a chance he will play for a few years.
Feel free to comment on my opinion. This topic is mostly created to discuss this matter. Posted Image