• Welcome to Dark Bit Factory & Gravity.
 

Tiny, tiny OpenGL window and shader setup code

Started by taj, October 25, 2007

Previous topic - Next topic

0 Members and 0 Guests are viewing this topic.

taj

Update:

I've been working on a 1k recently. To cut a long story short, I managed to get the OGL framework down in size by repeatedly  :whack: myself. The framework does the following:

* Opens a window full screen, any size
* Draws a rectangle to cover the screen
* Creates and tuns a minimal shader
* PASSES a TIMER into the shader
* Handles ESC

In all, using my crinkler and VC++ settings , it clocks in at 821 bytes which levels the playing field between OGL and D3D a bit more (considerably infact). If you want the framework send me a PM.

Taj
Challenge Trophies Won:

rain_storm

Quote from: taj on February 24, 2008
In all, using my crinkler and VC++ settings , it clocks in at 821 bytes which levels the playing field between OGL and D3D a bit more (considerably infact). If you want the framework send me a PM.

Im happy for you big guy. Bet that took a whole lotta head scratchin to do

Challenge Trophies Won:

taj

Quote from: rain_storm on February 24, 2008
Quote from: taj on February 24, 2008
In all, using my crinkler and VC++ settings , it clocks in at 821 bytes which levels the playing field between OGL and D3D a bit more (considerably infact). If you want the framework send me a PM.

Im happy for you big guy. Bet that took a whole lotta head scratchin to do

Well I started work on this 1k in November of last year , so 3 months its taken on and off.
Challenge Trophies Won:

benny!

Quote from: taj on February 24, 2008
Update:

I've been working on a 1k recently. To cut a long story short, I managed to get the OGL framework down in size by repeatedly  :whack: myself. The framework does the following:

* Opens a window full screen, any size
* Draws a rectangle to cover the screen
* Creates and tuns a minimal shader
* PASSES a TIMER into the shader
* Handles ESC

In all, using my crinkler and VC++ settings , it clocks in at 821 bytes which levels the playing field between OGL and D3D a bit more (considerably infact). If you want the framework send me a PM.

Taj

Great news. Congratulations, taj. Now the war of between OGL/D3D
is open again ;-)
[ mycroBLOG - POUET :: whatever keeps us longing - for another breath of air - is getting rare ]

Challenge Trophies Won:

taj

If you want to see code , its linked off my blog (http://sizecoding.blogspot.com/). Get the code for chocolux and you'll see three new tricks:
1. glRecti passing in time ! This is the big one.
2. #pragmas to assist crinkler (6 bytes saved - your mileage may vary)
3. __forceinline for the shader setup (1 byte - your mileage may vary)

This framwework is even smaller than Iqs :-)
Taj
Challenge Trophies Won:

Rbz

Wow, the timer using GetTickCount() + glRecti idea is just amazing!
Challenge Trophies Won:

zplex

Hi folks, and thanks for a nice forum. I am trying to compile taj`s code in Visual Studio .Net 2005, but get an "error LNK2001: unresolved external symbol _WinMain@16" File: MSVRCT.lib error message. What can cause this problem, do i need to update the SDK?

taj

zplex,

no you dont need to. It sounds like you are trying to compile as a console application not a windows application. I'll upload a minimal framework (give me a bit of time) and I hope you can import into VS2006 (I'm using VS Express).

Good to see you here.

Taj
Challenge Trophies Won:

taj

OK Zplex,

in the archive is a wholly contained VC project with my source for my latest 1k (chocolux). This is a good base which you may strip the shaders out of and replace with your own.

Download the archive and unpack
Then get crinkler from here:http://www.crinkler.net/ (the license of crinkler means I cant include it)
Put crinkler in your project directory but rename it to link.exe
Double click project file (dont try to start a new project yourself)

--- up to here it all works with VC Express (checked)

VC 2006 .NET ... I hope it imports OK.

If not, we'll do it the hard way :-)

Taj
Challenge Trophies Won:

zplex

Thanks man, really fast response :) The only thing that was a little troublesome now was that it didnt recognize the glext.h file in the project. But i just made a copy of it and put it in my C:\Programfiles\Microsoft Visual Studio 8\VC\PlatformSDK\Include\GL folder.

Here is a screenshot of the Visual Studio version i use, never heard about the 2006 version though :/


taj

Think I got confused...never mind :-) glad it works. Have fun.
Challenge Trophies Won:

Jim

Challenge Trophies Won: