Wednesday, August 12, 2009

Mingw + DirectX

I am currently a student at University of Illinois, Chicago doing masters in Computer Science with focus on graphics programming. I decided to learn directx and what could be a better way to do that other than programming it?. I have microsoft Visual c++ installed on my system. But I am a big fan of g++. Hence I decided to do a small project with directx graphics and mingw compiler.

Trouble starts here. There is very little information on the internet about combining directX and mingw. Most of the users seem to use DevCPP or visual c++. Anyways without losing hope, I searched and found this useful website by link. Having this page as foundation I started the installation process. I thought to myself "what if there is little or no information about this topic on the net? I will experiment and write a blog about it" and here it goes.

I already have mingw's latest version. To learn more about Mingw with Opengl please visit my "Mingw + glsl" blog. I also have mingw utilities to use the reimp tool. Now reimp tool is used to convert *.lib files to Mingw compatible *.a files.

Next I downloaded directx sdk for windows Vista ( And yeah I have Vista) . Installed directx to C:\Program Files\Microsoft DirectX SDK (March 2009). Now to make directx libraries compatible with Mingw, I used reimp tool to convert all the *.lib files of C:\Program Files\Microsoft DirectX SDK (March 2009)\Lib\x64 to *.a files. I moved those reimp'ed files from to C:\MinGW\lib\directx. Created a new folder directx under lib for directx libraries.

Then I moved header files (*.h) files from C:\Program Files\Microsoft DirectX SDK (March 2009)\Include to C:\MinGW\include\directx. Directx folder will not be there under include, so created one.

Now in the program, include the header file as #include and while running compile command include the library as -ld3d9 for e.g:
g++ demo.cpp -ld3d9

I ran my first directX "hello world" sorta program from http://www.directxtutorial.com/ and it compiled and ran successfully. looking forward to learn more about DirectX

hope this piece of information helps you with g++ and DirecX combination.


Friday, July 31, 2009

slist: No such file or directory

Error:
slist: No such file or directory

code:
#include

Environment:
Mingw’s g++ compiler

Solution:
Copy slist file from C:\MinGW\include\c++\3.4.5\ext to C:\MinGW\include\c++\3.4.5

Explanation:
Slist belong to extension, if you want to use slist in your program, you have to have the file in your include directory. Otherwise in the program you might have to give #include .

Saturday, March 21, 2009

Galaxy commander game

As a part of video game course, we (team of 4) are developing a video game for multi touch table. this game is similar to galcon: galaxy conquest. fast action packed game now available for iPhone also.

To know more about our game development, please visit http://sites.google.com/site/tuffpanda

btw our game company of 4 is named as Tuffpanda Games :)

here is a video of our finished game displayed at Tactile - a multi-touch multi-user table built at Electronic Visualization lab at UIC, chicago

Monday, December 15, 2008

My Projects

Hi,

this is a link to a website, where i have uploaded my recent projects and relevant codes and project description. please view them if you are interested

http://suja.synthasite.com/index.php

Monday, October 13, 2008

glsl with mingw

GLSL Installation on windows vista (32bit)

This installation direction is for installing opengl shading language with windows vista using mingw


opengl support for vista

1)download the current drivers for your graphics card from www.support.dell.com, to fully use the hardware acceleration of your graphics card.

2)check in c:/windows/system32/ for opengl32.dll, glut32.dll. They will be automatically installed in vista. If not, install the driver from support.dell.com.

mingw installation

3)install mingw (if u dont want to go through the trouble of visual studio usage, or you are comfortable with command line usage, like me :) ) from http://sourceforge.net/project/showfiles.php?group_id=2435 (automated mingw installer). run the file, and it will do the work for you.

4)from the same url, install mingw utilities. it has reimp command which is used to convert *.lib files to *.a files. tar.gz files can be extracted in windows using a freeware 7-zip which could be installed from http://www.ofzenandcomputing.com/zanswers/1072

glut installation

5)http://mywebpage.netscape.com/PtrPck/glut.htm install glut from this page, and use reimp to convert glut32.lib to libglut32.a.
Command: /mingw-utils/bin>> reimp.exe glut32.lib
copy this libglut32.a file to mingw/lib directory, and replace the old libglu32.a file. The old files gives out some "undefined reference to `__glutInitWithExit@12'" errors, which the new file eliminates.Copy the dll file to c:\windows\system32 and .h files from GL/ to c:/mingw/include/GL/

msys installation

6)run msys.exe file from http://prdownloads.sourceforge.net/mingw/MSYS-1.0.10.exe?download to install msys. msys is used to build glew from the source, since using glew binaries for windows gives out errors of the form "undefined reference to `_imp____glewGetShaderiv'". installation process will ask for mingw path. give the full path c:\mingw or whichever path mingw is installed in. msys will get installed into path/msys/1.0. Run the msys batch file. this is a shell program.

glew installation

7)download glew source file,(latest:1.5.0, has support for opengl 2.0, which inturn as support for glsl 1.2) zip file from http://glew.sourceforge.net/, and extract the folder to somewhere inside /msys/1.0. open msys shell program (batch file), and Go to the folder where the makefile in glew directory is present. cd /home/glew. Run the command: make

now copy the GL/glew.h, glxew.h, wglew.h to mingw/include/GL/ folder. copy lib/libglew32.a, libglew32.dll.a files to mingw/lib. copy glew32.dll to c:/windows/system32 folder.

thats all folks. your opengl shader program should compile and execute beautifully in windows vista.

other links


for furthur information please go through the following links

about opengl installation: http://www.opengl.org/wiki/index.php/Getting_started
about opengl usage: http://www.dgp.toronto.edu/~mjmcguff/learn/opengl/
about mingw setup: http://www.jumpstation.co.uk/info/mingw_setup_guide.html

Monday, February 11, 2008

Wubi review . part 2

continued from review part1
The most awaited 1gb ram came home in a nice package. I was very excited to experience fast performance, that I forgot one simple detail. Screwdriver to open the computer module. The screw is very small that none of my screwdrivers would fit. So I had to wait until yesterday to purchase a precision screwdriver set from walmart for 5$. Today morning, I opened the module at the back of my dell inspiron 600m laptop, and installed the new 1gb ram. starting windows showed me 1.5 gb of total RAM. "whew". Now I can continue the wubi ubuntu installation.

For the past few days, my windows client could not detect any wireless networks in range, and was asking me to switch on my radio, I tried to troubleshoot this for some time, but none worked. So I took my other laptop and searched in the net for ubuntu offline installation proceedure. I searched on my laptop and found the offline installation file, saved the exe file, and this offline iso file in the same folder, and started installing in 6gb space.

As the system rebooted, I went inside ubuntu, and the installation started. Last time the system hung when it was trying to install softwares for ubuntu. So I was biting my fingernails when the system started "installing softwares" proceedure.

1% completed
2%
3%
4%
6%
.
"Please God, dont let it fail"
.
.
8%
9%
"I will come to temple this weekend, if the installation goes smoothly"
10%
11%
I am praying with mumbled sound
12%
.
.
.
.
.
25%
"whew 25% completed, plz God take this through 100%."
.
.
.
.
.
.
30%
"It is in your hands God. plz plz plz dont fail me"
.
.
.
.
.
40%
I had a bit of relief, since I thought the rest will go on smoothly..
.
.
.
.
50%
still praying. Half completed. rest has to go
51%
52%
53%
beep
beep
Oh no, what now?
"SYSTEM IS IN CRITICAL TEMPERATURE. PROCEEDING TO SHUT DOWN. TERMINATING PROCESSES"

NOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO

my mom comes out of the other room "what happened? did u fall down?"

I google on my other laptop to do something about this temperature and could not find anything relevant, so I use the old age method. Turning on fan-only on my A/C.

So, I tell my mom to take my kid Sanjay and go to the other room where it is warmer.
my mom asks me " are you feeling ok dear? because I see that you have gone crazy putting the A/C on when outside temperature is -22F

You see, I live in westmont, Illinois and the temperature outside is -1F and feels like -22F. Who in their senses will turn the A/C on in this weather?. I did .... for my laptop and love of linux.

Anyways, now I uninstalled again, and installed with 4gb space, because I dint want anything to go wrong now. I decided this is going to be the last try. If my stupid system cant install ubuntu this time? after all these work of adding more memory, putting the A/C on, and using the least memory possible 4gb, if it still cant install, then probably my system does not have the right to have ubuntu. yes, thats right, Oh system, you deserve this punishment. hahaha (villaneous laughter).

What else do you expect me to say? I have uninstalled and installed about 25 times. If it still doesnt make it, I will have to live with windows, and find another way to use linux.

Ok, so I threaten my lappy, pray to God, touch my lucky charm, and reboot.

installing softwares
1%
2%
3%
4%
5%
.
.
.
.
.
20%
good until now. last time, it went off at 53 % when it was installing telnet. Let me wait until 53%
.
.
25%
I touch the base to see if it gets heated up. no. still warm only
.
30%
laptop still warm. good.
.
.
.
.
40%
laptop still warm. still praying
.
.
.
.
50%
here it comes
51$
52%
53%
.
.
.
54%
55%
whew. Good going
.
.
.
.
60%
.
.
.
.
70%
I take the laptop from the table and hold it in my hands careful so that its base is not touching anything. hehe I just wanted the cpu not to overheat.
.
.
.
.
80%
plz God install this successfully
.
.
.
.
90%
.
.
.
.
98%
99%
just one more to go
100%

yuppie... hurray
oh no what is this? another bar
ok finishing installation. good good

1%
.
50%
.
.
83%
why is this pausing at 83% for a long time.?
Still holding the laptop in my hands.
oh no
System proceeding to shut down
GREAT JUST GREAT.

I gave you my ultimatum, and this is your choice. thats it. no more wubi for you. bad lappy.

When the system rebotted, it directly went into windows os. I went to the drive and placed my mouse over the uninstall icon.

wait a minute. it said finishing installation. may be it finished and restarted. ok let me give this a try. I rebooted and clicked ubuntu this time.

HURRAY.. GREAT GOD. THANK YOU THANK YOU

kubuntu started and asked for user name password. and it went in. I was so happy that I shouted again YESSSSSSSSSSSSSSSSSSS, and my mom came out from the otehr room and asked again " are you alright?"

So I explored kubuntu for a while, and found that internet was not working, since it was a problem in windows os itself. I tested hello world in c++, python, perl and found them running.

After 3 hours of struggle, I finally installed kubuntu, and it is now up and running.

Wednesday, January 30, 2008

PC Restore in DELL inspiron 600m

I wanted to improve performance on my laptop, so I decided to do PC Restore in my dell laptop. My system was damn slow, and I got fedup with all the hangings and the end nows.

So It took me a whole day to convert my data into winrar, and move it to another laptop using my 512 mb flash drive. Now you might ask, why in God's name would i want to move it to another laptop, when I have cd burner on this one itself. well, when I checked with the cd burner of the second laptop, I found out that it has dvd burner too. Now, I dont know fully about this system, because it is my husband's office laptop, given to continue his office work at home.

Anyways, I found out that the seond system has dvd burner in it, and each dvd can hold 4.7 gig of data. So I winrared my important data and copied it to the second system. After every data was safely secured, I added the folder to dvd burner, and clicked "RECORD". This error message popped up on the screen. "NO SUITABLE SOFTWARE FOUND FOR BURNING DVD."

Great just great. I had to save all the data in six 700mb-cds, which took about another four hours.

Now that all my data is safe on cds, I prayed to God, and rebooted the laptop, entered ctrl+f11 when it was booting. Seems I dint hit the keys at the appropriate time. So the system went straight to user login screen, and I had to reboot again.
Finally the PC Restore screen came up. I prayed once again that the system shouldnt mess up, and confirmed the restore.

It took about 10 minutes only for the whole process. The system rebooted, and went through some basic formalities. Lo and presto my lappy is fast again. *whew*.

I should have stopped there. But I dint. I want to install freebsd as the second operating system. So I installed partion magic, and tried to partition the disk from only c: to c:, e:, f: g: with g: for freebsd.

But as I was partioning, I found out, that only c: could be primary partition in my drive. The others became logical drives. I read online that freebsd could be installed only on a primary partition. So I was trying different techniques to bring about atleast one extra partition as primary. But in vain.

Finally I thought If I could first bring down the size of c:, then I could later partion the rest using windows disk management. So unfortunately, I reduced the size of C: to 7gb, and rebooted as asked by the disk manager.

The lappy rebooted, and proceeded to resize c:. As it was proceeding, I had an instinct to cancel, and go back. If humans start listening to their instincts, then half of their problems will be solved. As humans err, I too failed to listen to my inner voice, and waited until the resizing became 100%.

Then started my problems. After resizing, I went back, and after trial and error, found out that
i could not create another primary partion,
could not increase the c: size because it cant be done in NTFS,
and could not hence install freebsd.

Depressed, I switched off my system with a small hope that there might be an online shell available to work on unix commands, atleast. Instead I found wubi ubuntu installer