Dark Bit Factory & Gravity
PROGRAMMING => C / C++ /C# => Topic started by: lucastar on April 15, 2013
-
Hi, it's me again with another issue...
I'm trying to use Crinkler with VS2005 (i tried with 2010 too), and in the moment that loads glut32.lib this happens:
1>Loading opengl32.lib...
1>Loading glut32.lib...
1>Oops! Crinkler has crashed.
I didn't find anything about this, and is taking me crazy... is glut not compatible with crinkler?
-
tbh, I've never tried using glut with crinkler, but I can't see why it would cause problems. if you want to upload a sample project/sln, I'll have a look for you. I may not be able to resolve the issue, but it would at least discount the problem being specific to your setup :)
-
Also, you should be aware of the fact that GLUT isn't system-standard on Windows, and should probably be avoided in case of a 4k.
-
I don't want a 4k intro, but i don't know other way to make the .lib files be inside the .exe.
I'm veeery noob at attaching resources to a .exe. Is there any other way that doesn't use VS?
tbh, I've never tried using glut with crinkler, but I can't see why it would cause problems. if you want to upload a sample project/sln, I'll have a look for you. I may not be able to resolve the issue, but it would at least discount the problem being specific to your setup
thanks, when i get home i will upload it.
-
Ah, I see; then let's solve the real issue instead :)
Are you building GLUT from source, or have you obtained a binary (.dll/.lib pair)?
If you're building from source, I don't think there should be any problems just popping the source in your project and firing away. In this case, uploading the project (or some simplified version of it) would be quite helpful, as someone like Raizor would be able to take a look and help you out for sure.
If you have a .lib & .dll from somewhere, however, then you can't build it all into one .exe without it depending on the .dll in the end. In this case the .lib just contains information about available methods in the .dll, and doesn't eliminate the dependency on the library at all, no matter which linker you use. So, if you really need GLUT, try building the source with your project or to a static library and link that in, or consider eliminating GLUT altogether.
-
Are you building GLUT from source, or have you obtained a binary (.dll/.lib pair)?
I have included the .lib as an external library, and the dll is on Windows->System32.
So, if you really need GLUT, try building the source with your project or to a static library and link that in, or consider eliminating GLUT altogether.
I don't "really" need it, but it makes window management a lot easier. I've tried to use crinkler with another project using only opengl32.lib, but when i managed to resolve all the errors, mi .exe didn't work.
Yes, I'm pretty lost about this. As i said, i will later upload the .sln
-
If you're not heading for 4k you're probably happier with kkrunchy (http://www.farbrausch.de/~fg/kkrunchy)...
-
I have included the .lib as an external library, and the dll is on Windows->System32.
how are you including it?
to use an import lib like that you can just do
#pragma comment( lib, "glut32.lib" )
note: the pragma comment method only takes full paths or jus the lib name, you cant do "..\.." which is a bit annoying!
(i dont use glut, but i use glew by directly including the source into a lib in my project with my common code in and i then include my lib in my projects)
-
how are you including it?
to use an import lib like that you can just do
#pragma comment( lib, "glut32.lib" )
I am including it as an additional dependence on the linker input in VS.
I honestly don't know how #pragma comment works... :-\
-
to use an import lib like that you can just do
#pragma comment( lib, "glut32.lib" )note: the pragma comment method only takes full paths or jus the lib name, you cant do "..\.." which is a bit annoying!
I must admit it looks tempting but I strongly suggest not to do it that way.
It just doesn't make sense to put linker settings into the source code.
And it's a terrible pain to fix relative paths if you ever decide to restructure a bigger project.
-
I must admit it looks tempting but I strongly suggest not to do it that way.
It just doesn't make sense to put linker settings into the source code.
And it's a terrible pain to fix relative paths if you ever decide to restructure a bigger project.
+1!
-
Here is the source, in VS8.
Files are not well organized because it is a migration from a codeblocks project.
As you see, this tiny project works, now i want to pack all resources in the .exe.
Thanks!
-
I must admit it looks tempting but I strongly suggest not to do it that way.
It just doesn't make sense to put linker settings into the source code.
And it's a terrible pain to fix relative paths if you ever decide to restructure a bigger project.
+1!
../.. only for home projects.. it is one thing i my list of things to sort out, but home code == fun code so pro/team work priorities don't matter so much!
at work we use lib paths and inc paths in vs, but choose linking via .lib either way.
its sometimes nicer to use the #pragma way as you can pic a different lib via #ifdef's without having to make a new build configuration. it also stops those compile errors that are release/debug only due missing out the libs in the configs.
-
Here is the source, in VS8.
Files are not well organized because it is a migration from a codeblocks project.
As you see, this tiny project works, now i want to pack all resources in the .exe.
Thanks!
So, you're not planning on making a 4k intro? If that's the case, then as Hellfire says, using Kkrunchy is probably a better idea and may well give you a smaller exe file. When I've tested Crinkler vs Kkrunchy for larger exe files (~64k), Krunchy wins pretty much every time.
-
does he even need that?
"but i don't know other way to make the .lib files be inside the .exe." makes it like he doesnt know how to include an lib file full stop.
as ferris pointed out, as its an import library it will always need the .dll
-
does he even need that?
"but i don't know other way to make the .lib files be inside the .exe." makes it like he doesnt know how to include an lib file full stop.
as ferris pointed out, as its an import library it will always need the .dll
I don't know how to include resources in a .exe, i told it before. I want to compress my code too. I thought than crinkler was used for that.
I do know how to use .lib in a project, i know how to use VS, i know how to use glut and other non standard libraries.
-
ok, so you now explicitly want to compress...
i tried your project but i'm using vs2008 sp1 and don't have glut.
what kind of resources do you want to include/embed?
i'll assume you mean a binary file like a picture, but works for model data etc
method 1
- convert it to a headerfile as a huge buffer
method 2
- stuff it in the resource table as a binary resource and use findresource(), loadresource() and lockresource() to access it
for size coding method 1 is probably far far superior
-
ok, so you now explicitly want to compress...
yes i do, sorry i didn't explained myself well.
i tried your project but i'm using vs2008 sp1 and don't have glut.
you have to got glut32.dll in system32/SYSWOW64, and .lib and .h files in VS install directory.
what kind of resources do you want to include/embed?
i'll assume you mean a binary file like a picture, but works for model data etc
-
ok, I follow now.
rather than writing a ton of instructions on using resources in vc++, check out this (http://www.dbfinteractive.com/forum/index.php?topic=5456.msg77339#msg77339). It's the sourcecode for a competition entry I made a while ago using C++ in VS 2008. It uses embedded resources for graphics and the sound, so should work as a guide for you. Have a look at the "gltLoadJPG" in "gltools.cpp", which loads a JPG file from an embedded resource.
The way I'm doing it is a bit longwinded. There are quicker way, depending on what you're loading. Have a look here (http://msdn.microsoft.com/en-us/library/windows/desktop/ff468902(v=vs.85).aspx) for some more information on the available resource functions.
-
I'm still happy to have a look at the project, but I only have VS 2012 here. So it will render the project unusable for you if I make changes to it :\
-
what kind of resources do you want to include/embed?
i'll assume you mean a binary file like a picture, but works for model data etc
mmm no exactly (i don't like using pictures, i prefer code-generated drawings). i was thinking about sounds, libraries and stuff.
ok, as raizor said the gfx/sound can go in the resources, libraries can too (DLLs that is not .libs)
For DLLs to work you'd have to either extract them to system32 (which you won't have write access from an app on a lot of windows machines) OR the directory your .exe is running from and dynamically import.
you won't be able to use a DLL for which you're using a .lib as you'll get into a cyclic dependency which would stop your exe from loading so you'd have to use dynamic imports if you embed a DLL.
-
I'm still happy to have a look at the project, but I only have VS 2012 here. So it will render the project unusable for you if I make changes to it :\
It's ok, i have VS2012 too. I made it in 2005 because i thought it could be a bug. Thank you very much!!
ok, as raizor said the gfx/sound can go in the resources, libraries can too (DLLs that is not .libs)
For DLLs to work you'd have to either extract them to system32 (which you won't have write access from an app on a lot of windows machines) OR the directory your .exe is running from and dynamically import.
you won't be able to use a DLL for which you're using a .lib as you'll get into a cyclic dependency which would stop your exe from loading so you'd have to use dynamic imports if you embed a DLL.
Ok, now i understand it. So the easiest thing is not using glut... or include the dll and extract it to use it in execution time.
Thanks!
-
I'm still happy to have a look at the project, but I only have VS 2012 here. So it will render the project unusable for you if I make changes to it :\
:o :o bitfonts scrollers!!! I wanted to learn that too! thanks!
Edit:
I watched the demo. Just... amazing. This things make me realize the little i know. It's now on my top 5 favourite demos (and i usually like much more retro demos). I deduce you work for some game company or something... ::)
-
I'm still happy to have a look at the project, but I only have VS 2012 here. So it will render the project unusable for you if I make changes to it :\
:o :o bitfonts scrollers!!! I wanted to learn that too! thanks!
Edit:
I watched the demo. Just... amazing. This things make me realize the little i know. It's now on my top 5 favourite demos (and i usually like much more retro demos). I deduce you work for some game company or something... ::)
Haha, are you talking about my phenomena intro? If so, I'm flattered, thank you :)
No, I don't work for a game company, this is all just hobby stuff for me. I do (mostly) boring security/defence stuff for work these days, so demo coding is just for fun. To be honest, I learnt pretty much everything I used for that intro here, at the DBF forum. Just lots of hours trying stuff out, reading tutorials and studying other peoples code and blogs is all you need really. I'd only been using OpenGL for less than a year when I made that, so don't get disheartened. A little bit of work and studying and you can make some really nice stuff.
This things make me realize the little i know.
I think that's the same for most of us mere mortals ;) I try and look at it along of the lines of "seeing something really cool makes me want to find out how its done". I've never been that great at math either, so don't stuff like that put you off either. Perhaps enter the next DBF demo competition? It's really good practice and a great way to get feedback on your work. You'll also find a lot of people here willing to give you pointers and tips too.
-
So the easiest thing is not using glut...
There's nothing wrong with glut as long as you're not heading for really small filesizes.
If you just want to get rid of the dll you can use a static version of the lib.
This way all the functions are linked into your exe and are not loaded from from the dll.
I haven't used glut for a decade but I'm pretty sure there's a static version available for download.
or include the dll and extract it to use it in execution time.
Nah, that's crap! :P
-
I haven't used glut for a decade but I'm pretty sure there's a static version available for download.
I will search it and try to download it. But is opengl a static library?
Perhaps it will be better use "pure" opengl...
Thanks!
-
Perhaps enter the next DBF demo competition? It's really good practice and a great way to get feedback on your work. You'll also find a lot of people here willing to give you pointers and tips too.
I second that, I'd been dabbling here n there, my entry for the last one really helped jump start me and forced me to learn some stuff and I'm now spending a spare evening or wet weekend afternoon coding pretty much every week now.
I also keep finding on these forums that I'm following the footsteps of some GL stuff Raizor did in 2011 ;)
-
I will try, but i am pretty far from the demos posted here. I know vey little about 3D programing and let's not talk about shading...
At the moment i'm working on this 2d retro... and is causing me a lot of trouble as you can see xD.
Thank you very much guys for all your help!
-
Hah you haven't seen what I entered then, the last challenge was 2D :)
and it was the first ever OpenGL ES program I'd ever written... as GL ES is 'modern gl' I had to learn about shaders to get it done...
Its amazing how much I learned even from that.. and how much i've moved on since then (including now using proper GL v3+)
-
You can probably remove GLUT from your code without too many hassles. Have a look at IQ/RGBA's 64k intro framework (http://www.iquilezles.org/www/material/framework64k/framework64k.htm), which uses SetWindowText to display the current FPS in the window titlebar and contains code for setting up an OpenGL window without GLUT. Having said that, if you're not concerned about filesize, then the static GLUT lib is probably a good bet. I've never used the static GLUT myself though. One thing to bear in mind when looking at IQ's framework is that it doesn't link to the default libraries which may cause you some headaches (as you're using Vectors). Again, if you're not worried about size, then that's probably not a problem...
-
I will try, but i am pretty far from the demos posted here. I know vey little about 3D programing and let's not talk about shading...
At the moment i'm working on this 2d retro... and is causing me a lot of trouble as you can see xD.
Thank you very much guys for all your help!
3D and shaders really aren't that scary once you get your head around the basics. OpenGL and Direct3D take a lot of the pain away now, so you can get stuff moving around in 3D without understanding too much about what's going on behind the scenes. It's worth learning a little bit about how matrices and what OpenGL does behind the scenes, but in depth knowledge is not essential, at least not to begin with. It'll probably take you a few days of fiddling around, but seeing your first homemade light-sourced cube spinning around in OpenGL will be quite a thrill. You can then build on that and make it move around in time to the music, throw some textures on it or whatever you fancy. Just start small and build on it as you go. Once you're a bit more comfortable, you can start playing with shaders too and really go wild. Of course, there are a ton of exciting things to do in 2D too :D
-
Hah you haven't seen what I entered then, the last challenge was 2D :)
where can i see it?
and it was the first ever OpenGL ES program I'd ever written... as GL ES is 'modern gl' I had to learn about shaders to get it done...
GL ES... i will take a look at that
You can probably remove GLUT from your code without too many hassles. Have a look at IQ/RGBA's 64k intro framework (http://www.iquilezles.org/www/material/framework64k/framework64k.htm)
I will take a look at that too... and include std libraries! xD
It's worth learning a little bit about how matrices and what OpenGL does behind the scenes
Yes, in fact i like very much that, very low level programming and math stuff. It just is so extense... my head can't learn so fast xD. Right now i can just understand how to draw and move 3D objects.
PD: i have now changed my user name because i found some page over there with "CosmicColour", and i don't like repeating names... this one is definitive
-
All the challenge ever done here can be found here > http://www.dbfinteractive.com/forum/index.php?board=9.0
GL ES is 'just' a cut down OpenGL for mobile platforms, its based upon the shader GL stuff introduced in OpenGL 2.0 ish.
> http://en.wikipedia.org/wiki/OpenGL_ES
If you want to do raspberry pi, ipad or android tablet graphics then its what you need to learn.
For now i'm forgetting about it and sticking to desktop OpenGL, I'm trying not to do anything that won't work on ES when i decide to port stuff to ipad or raspberry pi.
-
If you want to do raspberry pi, ipad or android tablet graphics then thats its what you need to learn.
I did something for android using libgdx, but i quit because i don't like java and it was only (i think) for 2D... and my hart always tells me to code for pc xD. I though that using opengl in android was not recommended.
Raspberry is a very interesting option to make pretty things... but i have a lot to learn before.
-
IQ/RGBA's 64k intro framework (http://www.iquilezles.org/www/material/framework64k/framework64k.htm)
My firewall is the only one that detects a virus there??
Damn i wanted to take a look at that... :'(
-
IQ/RGBA's 64k intro framework (http://www.iquilezles.org/www/material/framework64k/framework64k.htm)
My firewall is the only one that detects a virus there??
Damn i wanted to take a look at that... :'(
You'll get that a lot as soon as you start going anywhere near exe compressors. The heuristics engines in most antivirus software cause the same problems. I usually have a rule in my antivirus to exclude my development directory from scans. It's also handy to have another excluded location where you can drop demos and intros you want to watch. Obviously be careful what you run in that directory though :)
There are some 'sandbox' programs out there that will let you run a program in isolation. I've personally never bothered much with them though. Sandboxie (http://www.sandboxie.com/) is one I looked at a while back.
-
Ok, i will turn off my antivirus to download it.
Thanks!
Another question... on the image: the colours of the "Welcome" word are usually code-generated or textures?
-
I'm probably not the best person to answer that, but I'd imagine there's a gradient background and the text acts as a stencil so that the characters are transparent and show the background gradient. Someone like Padman would probably be able to give you a more accurate answer :)
-
I'm probably not the best person to answer that, but I'd imagine there's a gradient background and the text acts as a stencil so that the characters are transparent and show the background gradient.
Time ago i did exactly that with SDL... but i thought that was not the correct way to do it.
-
Time ago i did exactly that with SDL... but i thought that was not the correct way to do it.
Back in time most video-chips could tell you when the cathode ray jumps into the next scanline.
If you used this to simply change one of your colors, you got fancy vertical gradients.
Todays "oldschool" intros are just immitating this effect but there's usually nothing clever behind it.