Posts Tagged ‘windows’

20100309 Breakpoint demolog, day 34: VSTi+Renoise working again

I managed to compile the VST instrument for Windows. There were some odd differences between Linux and Windows in the main.cpp side of things, so at the end I just made a new main_windows.cpp and forgot about trying to wrap incompatible things with #ifdef/#endif pairs. I also had to add an esoteric .def file so that Renoise would recognise the .dll as a plug-in file…

All in all, I’m finding Visual 2008 superverbose, superboring and superslow to work with. I don’t know if I had just idolised VC6 but I don’t remember it being so cumbersome. For example, the autocompletion or “intellisense” thing doesn’t show me useful stuff most of the time… it usually shows me a list of low level Windows constants that I obviously don’t care about, instead of showing me classes from my project. Also, the keys for triggering autocompletion are super odd (ALT + right arrow) instead of the usual CTRL+Space. I haven’t found the option for automatically adding matching braces, so I have to do it manually. The options and general semantics are annoyingly microsoftive (e.g. “Solutions” actually means “a generated binary”), editing project properties is annoyingly slow, and etc, etc. Even the XCode configuration panels look nice compared to this!

What is also possible is that I have got accostumed to Makefiles and the whole idea of going through a series of tabs and trees and options and blablah just looks silly at this point. We’ll see if I end up liking it at the end…

End of the mini-rant and back to the demo: I got a new version where a simple representation of the left/right buffers is painted on each frame. That’s the most advanced graphical stuff I’ve done to date in this project, hehe. The sound is quite saturated in comparison with the output I get in Renoise for the same song. It’s probably due to the fact that in my code I’m not doing any clipping in the output of SorolletVoice and am adding all together in the mixer, but Renoise is probably clipping each voice internally when it gets the output of each VSTi instance. So I’ll add that tomorrow… otherwise as soon as more than one instrument is playing at a relatively loud volume, hardly anything can be distinguished!

20100308 Breakpoint demolog, days 32-33: moving to Windows

Since I’m going to be away from my main computer for a few days, I reformatted mrdoob’s laptop so that it could run Windows. Mind you, this is a Macbook Pro computer, which means that installing Windows is a long process, specially if you make a mistake and have to reinstall Leopard from start again!

So it was a “very interesting” Saturday evening+night: the computer doing its stuff, while I cursed Bill Gates and Steve Jobs indistinctly. You can’t appreciate enough how fast the Ubuntu installation is, until you have to reinstall Mac OS or Windows again. How can they be that DAMN SLOW?!

Anyway, I managed to install Visual Studio and all that. I have even installed cygwin so that I can keep using a decent command line and git. I have set up a remote repository on a server, so that I can share the changes between computers too. Not that I think I’m going to touch much code in the Linux computer, but it’s good to have that. Just in case the laptop data gets corrupted or something :)

I have fixed the couple of bugs I had from Friday –nothing too serious, just some errors not being checked– and the “demo” is working as expected: the song is loaded, a simple triangle is shown in the screen while the song is playing and when it finishes, the demo exists. However there’s a bit of cracks and distortions here and there… I might probably have broken something in the SorolletVoice class while fixing something else, so what I’m going to do is to compile the VSTi for Windows, and compose the song using Renoise on Windows. After all, it’s all the same format at the end… and that way I can make sure that what I heard in Renoise is more or less the same than in the demo!

And the final paragraph is dedicated to Iq: the size of the simplest program that uses my player (the one which does a WAV dump) is 86kb, Release. When kkrunchified, it goes down to approximately 31kb. But my demo is using SDL… and that simple program doesn’t even open a window or output any sound anywhere, so I tried to load your 64k framework in Visual Studio 2008 –with the hope of using it as a base instead of using SDL– but it systematically refused to compile :-( There are errors in some structs from the events file, but I can’t quite get why, because they look perfectly fine to me. Maybe you’re using VS2005?

20100219 Breakpoint demolog, day 17: building for windows (from linux)

Windows and Linux executables, rotating a triangle and generating a sine wave audio stream

Today I decided to do something different. And I thought: Okay, I’ll try and sort out this compiling for windows issue, so that I can focus on the rest of more important things without having to worry about it any more.

And guess what…? I think I managed to do it :-)

Roughly, these are the steps I followed, just in case someone else wants to compile for windows with opengl and sdl support, using [ubuntu] linux:

  • install mingw (I did it with Synaptic Package Manager so that I didn’t have to go through the ./configure and ./make hell)
  • get the dev libraries from sdl for windows/mingw –this file– or check their downloads page
  • uncompress the file and locate the bin, include and lib folders within, and…
    • copy bin/SDL.dll to the folder where your win32 .exe will go — so that the exe can pick and load the dll when executing
    • copy the include and lib folders to a folder in your project’s src folder — or anywhere you’ve got access to! For example: project/src/libs/sdl/
  • now in your main.cpp, include SDL’s header files like this:
    #include <SDL/SDL.h>
    #include <SDL/SDL_opengl.h>
  • And the makefile could be something like this too:
    WINDOWS_SDL = ./libs/sdl/windows

    windows:
            i586-mingw32msvc-g++ -I$(WINDOWS_SDL)/include -L$(WINDOWS_SDL) \
    main.cpp $(WINDOWS_SDL)/libSDL.dll.a -o ../test.exe\
     -lmingw32 -lSDLmain -lSDL -mwindows -lopengl32 -Wl,-R.

(ugly hard line returns added by me so that you can see all parameters in one go).

This assumes you are invoking make from the src folder. The output will go to the parent folder. But well, the most important things that need to be highlighted are the bunch of switches you need to include in order to get the program to link:

-I$(WINDOWS_SDL)/include — this tells the compiler where to look for additional header files. This way it can find <SDL/SDL.h> and you do not need to modify the file or add #define’s when building for linux.

-L$(WINDOWS_SDL) — pretty much the same but tells the compiler to look for static libraries in the WINDOWS_SDL folder too

$(WINDOWS_SDL)/libSDL.dll.a — links the library into our binary!

-lmingw32 -lSDLmain -lSDL -mwindows -lopengl32 -Wl,-R. — these are magic – remove any of them and the linker will complain about missing symbols ;)

I still have to test this in a real windows machine; so far I have just tried with Wine. The output is a little jerky and a bit slower than the native (64 bit) counterpart, but I guess this will do much better than compiling in Virtual Box and testing with Wine :D

I’ll try to upload a test .exe when I test it on a real windows box myself, so that you can test it and see if it works in your computer (if you want, of course!). It’s ages since I compiled anything for win, and I truly wonder whether it will work with Vista/7… my last demo for Windows was done in 2005 and XP was in full glory back then :P

20090619 Bits & bites, 2

The menu for this week consists in: an appetizer of iPhone OS 3.0 and iPhone development ethics coming from unsustainable sources, and some slices of funny spam which may produce you constipation, a main dish based in Opera Unite topped with a little bit of failure from Microsoft (to give a bit of a sour taste), and for a sweet and fragrant dessert, PyGTK. There’s an optional disgustingly sour liquor for whoever which dares to try, made with proprietary software being used in a new installation in a school.

Read the rest of this entry »

20090222 WGA notification tool… why?

Much to my dislike, there’s still some software which doesn’t work yet with Linux, either natively or using the fabulous Wine, so for those cases where I still need to use win32 software, I use VirtualBox and a virtual machine running Windows XP.

My copy of XP is registered; I payed for it simply to avoid getting all those annoying warnings and various disgusting issues one can run into when using a pirated version of XP.

But still I get this idiotic update from time to time:

WGA

The Windows Genuine Advantage Notification tool notifies you if your copy of Windows is not genuine. If your system is found to be non-genuine, the tool will help you obtain a licensed copy of Windows.

Do they mean that this already genuine copy is going to turn into non genuine, just like that? Ta-daaaaaaaaaa! today I’m genuine, tomorrow I’m not? surprise! And that’s why they need to check every month? Didn’t they check the first time I entered my serial number?

Most probably they fear someone buying a license and then installing it in several other computers, but this way of fighting their fear is stupid. Just leave alone the nice chaps that installed and registered this weapon of mass destruction and go annoy people who haven’t completed your verification process or however it is called at this time.

Whenever someone asks me why I don’t want to use Windows again unless it’s caged on a (virtual) box, I’m so going to refer them to this!