Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411283 Posts in 69325 Topics- by 58380 Members - Latest Member: bob1029

March 29, 2024, 06:08:15 AM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperTechnical (Moderator: ThemsAllTook)The happy programmer room
Pages: 1 ... 156 157 [158] 159 160 ... 279
Print
Author Topic: The happy programmer room  (Read 673165 times)
_Tommo_
Level 8
***


frn frn frn


View Profile WWW
« Reply #3140 on: January 13, 2013, 05:18:16 PM »

or maybe you could run ubuntu in a virtual machine, forgot what it's called ah wait wubi.
because programming c in linux is very nice where windows is sort of painful to set it up in and work.


Visual Studio can indeed build ANSI C if you istruct it to (there's a flag somewhere) - just don't expect it to know anything about C99, though.
Logged

Polly
Level 6
*



View Profile
« Reply #3141 on: January 13, 2013, 06:31:30 PM »

When you use .c ( instead of .cpp ) as extension for your source files, Visual Studio will automatically compile them as C. Alternatively ( as _Tommo_ mentioned ) you can force the compiler to compile as C by setting "Compile As" to "Compile as C Code" in "Configuration Properties > C/C++ > Advanced" of your Project Properties.
Logged
s_l_m
Level 8
***


Open to collabs


View Profile
« Reply #3142 on: January 13, 2013, 07:41:29 PM »

or maybe you could run ubuntu in a virtual machine, forgot what it's called ah wait wubi.
because programming c in linux is very nice where windows is sort of painful to set it up in and work.


Visual Studio can indeed build ANSI C if you istruct it to (there's a flag somewhere) - just don't expect it to know anything about C99, though.

http://www.cygwin.com/

mingw is really nice too. If you just want a c compiler for windows and being able to compile *nix code isn't a primary concern, then go mingw. If you want to compile code meant for *nix or want to ensure portable code, go cygwin. Although that's not saying mingw code can't be ported, its just that cygwin is more accurate to unix imo
« Last Edit: January 13, 2013, 07:47:56 PM by s_l_m » Logged

Think happy thoughts.
a0x
Level 0
**



View Profile WWW
« Reply #3143 on: January 13, 2013, 08:55:21 PM »

or maybe you could run ubuntu in a virtual machine, forgot what it's called ah wait wubi.
because programming c in linux is very nice where windows is sort of painful to set it up in and work.


Visual Studio can indeed build ANSI C if you istruct it to (there's a flag somewhere) - just don't expect it to know anything about C99, though.

http://www.cygwin.com/

mingw is really nice too. If you just want a c compiler for windows and being able to compile *nix code isn't a primary concern, then go mingw. If you want to compile code meant for *nix or want to ensure portable code, go cygwin. Although that's not saying mingw code can't be ported, its just that cygwin is more accurate to unix imo

Anything you compile with cygwin will require an extra DLL file on windows though. MinGW compiles using the Microsoft runtime, so it doesn't require any extra DLL's. Just something that should be noted.
Logged
s_l_m
Level 8
***


Open to collabs


View Profile
« Reply #3144 on: January 13, 2013, 09:07:49 PM »

^this is true, I probably should have mentioned that. Slipped my mind though.
One more thing to consider, it is a lot easier to get a good ide set up with mingw (such as bloodshed, which is great). I mostly just use the included environment with cygwin, which may not be some peoples cup of tea. Also, I mostly use cygwin when I am trying to get code meant for linux to run on windows, which it is great at
Logged

Think happy thoughts.
Geti
Level 10
*****



View Profile WWW
« Reply #3145 on: January 13, 2013, 11:56:19 PM »

not fucking c++ google, not fucking c++. im sick of fucking fuckkedy having to quote c like "c" to get results for c, whats this bullshit google, get real. now. please
Nah man you know java and probably like objects, and you're not forced to use C++ libs and features and shit in C++ if you dont want to. C++ has operator overloads so your vector maths looks like vector maths ( not Vec2f vadd = vec2f_add(vec1,vec2);, Vec2f vadd = vec1 + vec2 ), and can still do non member functions and all that nice shiet. It'd be a smoother transition from java, just saying.

Codelite is a nice IDE if you're looking for free, minimal and fast, which seems like your style.
Logged

rivon
Level 10
*****



View Profile
« Reply #3146 on: January 14, 2013, 03:26:07 AM »

Just download this (the bigger codeblocks-12.11mingw-setup.exe version): http://www.codeblocks.org/downloads/26
You can program in both C and C++, compiler and debugger included.
Logged
_Tommo_
Level 8
***


frn frn frn


View Profile WWW
« Reply #3147 on: January 14, 2013, 03:54:42 AM »

When you use .c ( instead of .cpp ) as extension for your source files, Visual Studio will automatically compile them as C. Alternatively ( as _Tommo_ mentioned ) you can force the compiler to compile as C by setting "Compile As" to "Compile as C Code" in "Configuration Properties > C/C++ > Advanced" of your Project Properties.

AFAIK it's not the same, because .c files are compiled as "microsoft C" which is different from ANSI C... this StackOverflow thread explains it well.

PS: @anyone that mentioned DevCpp as something that can be used: nope.
Logged

nikki
Level 10
*****


View Profile
« Reply #3148 on: January 14, 2013, 04:30:52 AM »

I'd go the linux route (as I noted above) because of tools like valgrind and cachegrind and the gcc compiler.

Logged
Polly
Level 6
*



View Profile
« Reply #3149 on: January 14, 2013, 06:45:52 AM »

AFAIK it's not the same, because .c files are compiled as "microsoft C" which is different from ANSI C

The Microsoft compiler is ANSI compliant. It just has some extensions .. but you can disable those if you're afraid of somehow accidentally using them ( same link as you mentioned, top answer, step two ) Wink
Logged
Geti
Level 10
*****



View Profile WWW
« Reply #3150 on: January 14, 2013, 10:54:22 AM »

I'd go the linux route (as I noted above) because of tools like valgrind and cachegrind and the gcc compiler.
While making something cross platform is always a good idea, windows is still currently the largest PC gaming market by far, even for an indie, even in terms of profit you can wrangle out of customers. You're very likely gonna have to get it compiling and running under windows at some point if you want to fund your life with PC games.
Logged

rivon
Level 10
*****



View Profile
« Reply #3151 on: January 14, 2013, 11:48:37 AM »

windows is still currently the largest PC gaming market by far, even for an indie, even in terms of profit you can wrangle out of customers.
Humble Indie Bundle begs to disagree. Also, if your game is running under GCC then no porting is required for MinGW and the MS compiler should be able to compile it with pretty much no changes whatsoever if you need it for some unknown reason.
Logged
Quarry
Level 10
*****


View Profile
« Reply #3152 on: January 14, 2013, 11:50:16 AM »

Code:
public static int get32BitRGB(int col) {
return (Math.min((Math.max(0, (col >> 5) & 8) * ROG), 255)) << 16
| (Math.min((Math.max(0, (col >> 2) & 8) * ROG), 255)) << 8
| (Math.min(Math.max(0, col & 4) * B, 255));
}

It's supposed to turn 8-bit color into 32-bit color. At first I thought it worked but then noticed that it did not. Happy programmer for a few seconds

*garble garble*
Logged
Geti
Level 10
*****



View Profile WWW
« Reply #3153 on: January 14, 2013, 02:48:49 PM »

Code:
public static int get32BitRGB(int col) {
return (Math.min((Math.max(0, (col >>> 5) & 7) * ROG), 255)) << 16
| (Math.min((Math.max(0, (col >>> 2) & 7) * ROG), 255)) << 8
| (Math.min(Math.max(0, col & 3) * B, 255));
}
Off by one I think. DEC 8 is BIN 00001000, DEC 7 is BIN 00000111 for 8 bit bytes, unless something funky is going on with java integers. afaik you can use binary literals in java though, so 0b111 should work as well.

for those shifts you want a logical shift not a signed shift as well, I think. Haven't tested the code above, but hey, could help.
Logged

Muz
Level 10
*****


View Profile
« Reply #3154 on: January 15, 2013, 12:07:10 AM »

Wow, what the hell. I'm on schedule today. What's weird is that I've been testing out a technique where I spend 30 mins doing work followed 30 mins doing nothing. Apparently it helps a lot in clearing the mind for problem solving.

What's even weirder is that I've managed to accomplish pretty much everything on the to do list. Never actually seen the to do list empty.
Logged
Quarry
Level 10
*****


View Profile
« Reply #3155 on: January 15, 2013, 02:36:45 AM »

Code:
public static int get32BitRGB(int col) {
return (Math.min((Math.max(0, (col >>> 5) & 7) * ROG), 255)) << 16
| (Math.min((Math.max(0, (col >>> 2) & 7) * ROG), 255)) << 8
| (Math.min(Math.max(0, col & 3) * B, 255));
}
Off by one I think. DEC 8 is BIN 00001000, DEC 7 is BIN 00000111 for 8 bit bytes, unless something funky is going on with java integers. afaik you can use binary literals in java though, so 0b111 should work as well.

for those shifts you want a logical shift not a signed shift as well, I think. Haven't tested the code above, but hey, could help.

Stupid, stupid me. Thanks a lot for the help, works now

 Smiley++
Logged
Geti
Level 10
*****



View Profile WWW
« Reply #3156 on: January 15, 2013, 03:48:29 AM »

You're welcome, no need for the negativity :D

What's weird is that I've been testing out a technique where I spend 30 mins doing work followed 30 mins doing nothing.
Gotta try this shit. Sprints have been working well for us for the last 5 months or so, it gets pretty exhausting sometimes, haha.
Logged

sublinimal
Level 8
***



View Profile
« Reply #3157 on: January 15, 2013, 06:26:05 AM »

That's my primary pace of work, pretty much. Come across a problem, brainstorm some ways to solve it, then get my mind off it for a while before the actual implementation. It helps me to see it clearer if I let my internal garbage collector remove some traces of previous problems.
Logged
_Tommo_
Level 8
***


frn frn frn


View Profile WWW
« Reply #3158 on: January 15, 2013, 09:01:53 AM »

I've plugged Vertex Array Objects in my engine and now the most complex level in my 2D game is rendered in 0.67 ms, 4% budget, for a grand total of 1450 FPS, down from the old 1.01 ms Wizard

I should stop optimizing a game that renders in 0.7 ms, but IT FEELS GOOD MAN Epileptic
« Last Edit: January 15, 2013, 09:15:37 AM by _Tommo_ » Logged

Klaim
Level 10
*****



View Profile WWW
« Reply #3159 on: January 15, 2013, 09:15:24 AM »

Hahaha I understand the addiction  Evil
Logged

Pages: 1 ... 156 157 [158] 159 160 ... 279
Print
Jump to:  

Theme orange-lt created by panic