Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 264 265 [266] 267 268 ... 796

Author Topic: if self.isCoder(): post() #Programming Thread  (Read 883266 times)

MagmaMcFry

  • Bay Watcher
  • [EXISTS]
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #3976 on: February 25, 2013, 12:57:05 am »

Remember that platformer I made? Here's the source. The OpenGL calls are slightly scrambled (this was a bottom-up project), but should be easy to read.
Logged

MagmaMcFry

  • Bay Watcher
  • [EXISTS]
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #3978 on: February 25, 2013, 01:14:18 am »

Thanks be te ye good sire.
By the way, that's an Eclipse project there, you can just go ahead and import it, should run fine.
Logged

Max White

  • Bay Watcher
  • Still not hollowed!
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #3979 on: February 25, 2013, 01:17:49 am »

Do you mean to imply there is such a thing as a non-Eclipse java project?
What else would one program in, Netbeans? Hohohohoho.

MagmaMcFry

  • Bay Watcher
  • [EXISTS]
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #3980 on: February 25, 2013, 01:24:41 am »

Do you mean to imply there is such a thing as a non-Eclipse java project?
What else would one program in, Netbeans? Hohohohoho.
For all I know you could have used Emacs. C-x M-c M-butterfly.
Logged

LoSboccacc

  • Bay Watcher
  • Σὺν Ἀθηνᾷ καὶ χεῖρα κίνει
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #3981 on: February 25, 2013, 02:34:58 am »

Or vim and maven. Why nobody likes maven?
Logged

Mego

  • Bay Watcher
  • [PREFSTRING:MADNESS]
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #3982 on: February 25, 2013, 02:47:27 am »

Do you mean to imply there is such a thing as a non-Eclipse java project?
What else would one program in, Netbeans? Hohohohoho.
For all I know you could have used Emacs. C-x M-c M-butterfly.

You. I like you.

Mephisto

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #3983 on: February 25, 2013, 03:00:36 am »

Or notepad and javac...

Back when I was in college, we used Java nearly exclusively. One of the professors used the above for all of his work. It wouldn't be a problem if he were good at it, but he wasn't.
Logged

MagmaMcFry

  • Bay Watcher
  • [EXISTS]
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #3984 on: February 25, 2013, 11:34:02 pm »

Warglebargleargh. Trying to install proprietary NVIDIA drivers onto my Linux Mint partition for some advanced OpenGL features. Broke my computer while doing so, subsequently unbroke it. The drivers have yet to be installed.
Logged

Valid_Dark

  • Bay Watcher
  • If you wont let me Dream, I wont let you sleep.
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #3985 on: February 26, 2013, 12:43:31 am »

Suggestions for lowering CPU usage in SDL, other than "Learn OpenGL"
GO!
Logged
There are 10 types of people in this world. Those that understand binary and those that don't


Quote
My milkshake brings all the criminals to justice.

Skyrunner

  • Bay Watcher
  • ?!?!
    • View Profile
    • Portfolio
Re: if self.isCoder(): post() #Programming Thread
« Reply #3986 on: February 26, 2013, 12:53:37 am »

Step one, profile.

Edit: There's this computer-related theory that states 5% of your code takes up 95% of your runtime.
Also that famous saying that premature optimization isn't worth it.
Also you don't know what is taking up your CPU cycles. Maybe you wrote some inefficient code, or you're doing something stupid like access a vector with at() 160000 times a frame, thirty times a second. *cough cough*
« Last Edit: February 26, 2013, 12:56:15 am by Skyrunner »
Logged

bay12 lower boards IRC:irc.darkmyst.org @ #bay12lb
"Oh, they never lie. They dissemble, evade, prevaricate, confoud, confuse, distract, obscure, subtly misrepresent and willfully misunderstand with what often appears to be a positively gleeful relish ... but they never lie" -- Look To Windward

MagmaMcFry

  • Bay Watcher
  • [EXISTS]
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #3987 on: February 26, 2013, 01:02:13 am »

Step zero, limit your framerate.
Code: [Select]
// Initialize lastSyncTime to SDL_GetTicks().
// Then call this function every tick, with the framerate you want your game to run at.

int sync(int fps) {
unsigned int waitTime = 1000.0f/fps;
unsigned int currentTime = SDL_GetTicks();
while (currentTime - lastSyncTime < waitTime) {
SDL_Delay(1);
currentTime = SDL_GetTicks();
}
unsigned int waitedTime = currentTime - lastSyncTime;
lastSyncTime = currentTime;
return waitedTime;
}
Logged

Skyrunner

  • Bay Watcher
  • ?!?!
    • View Profile
    • Portfolio
Re: if self.isCoder(): post() #Programming Thread
« Reply #3988 on: February 26, 2013, 01:10:32 am »

That ounts as something stupid xD

Granted, won't find it from profiling, as easily.
Logged

bay12 lower boards IRC:irc.darkmyst.org @ #bay12lb
"Oh, they never lie. They dissemble, evade, prevaricate, confoud, confuse, distract, obscure, subtly misrepresent and willfully misunderstand with what often appears to be a positively gleeful relish ... but they never lie" -- Look To Windward

Valid_Dark

  • Bay Watcher
  • If you wont let me Dream, I wont let you sleep.
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #3989 on: February 26, 2013, 01:24:14 am »

Step zero, limit your framerate.

Already done,


going to poke around at some optimizations right now, even though its a bit premature,
I has hoping there might have been some sort of super secret to optimization secrets I didn't know about, but I guess not.

thanks anyways :D
Logged
There are 10 types of people in this world. Those that understand binary and those that don't


Quote
My milkshake brings all the criminals to justice.
Pages: 1 ... 264 265 [266] 267 268 ... 796