Author Topic: Hello World?  (Read 3649 times)

fiver (OP)

  • Posts: 84
Hello World?
« on: February 15, 2015, 02:22:52 am »
I've been thinking about dipping my toes into GCW development, because it looks like it might be fun. I've done simple programming in several languages, so this certainly wouldn't be my first project ever, but I don't know how to specifically write and package a GCW app. It would need, at minimum, a window with the words "Hello World" on it. (I'm sure you can write command-line programs for it, but that doesn't seem like a good idea.)

So, how do I get started?

computerguy

  • Posts: 37
Re: Hello World?
« Reply #1 on: February 15, 2015, 07:23:25 am »
Try here:    http://wiki.surkow.com/Category:Development    it should help get you started

zapateo

  • Posts: 3
Re: Hello World?
« Reply #2 on: February 22, 2015, 06:40:53 am »
I suggest you to start with Love2D (https://love2d.org/), in this way you don't have to compile your code. Just write a simple "Hello World" in a 320x240 window

Code: [Select]
function love.load()
love.window.setMode(320, 240)
end

function love.draw()
love.graphics.print("Hello World!", 10, 10)
end

 test it on your system, make an OPK and load it into your GCW0. You should run it without any problem.
If the test is successful, you can write something in C++ using the SDL2 library.
You can download the Toolchain from here: http://www.gcw-zero.com/develop
« Last Edit: February 22, 2015, 06:47:25 am by zapateo »
Sorry for my bad english :/

fiver (OP)

  • Posts: 84
Re: Hello World?
« Reply #3 on: March 13, 2015, 11:25:04 am »
I got it to run on Linux, but not GCW-Zero. The OPK just crashes. (Well, when I try to run it with DinguxCmdr, it just kicks me back to the desktop.) I zipped main.lua, renamed it to main.love, and then packaged it with a .desktop file using mksquashfs... I don't know what I'm doing wrong.

pcercuei

  • Posts: 1666
    • My devblog
Re: Hello World?
« Reply #4 on: March 13, 2015, 11:55:48 am »
DinguxCmdr cannot run OPKs.
Also, what is the content of the .desktop?

fiver (OP)

  • Posts: 84
Re: Hello World?
« Reply #5 on: March 14, 2015, 04:31:20 am »
DinguxCmdr cannot run OPKs.
What's the "Execute" command for, then?
Quote
Also, what is the content of the .desktop?
Code: [Select]
Type=Application
Name=Hello World
Comment=We are Brighton
Exec=helloworld
Icon=icon
Categories=games;

pcercuei

  • Posts: 1666
    • My devblog
Re: Hello World?
« Reply #6 on: March 14, 2015, 10:26:34 am »
If your file is named main.love, then the .desktop file should contain:
Exec=love main.love

fiver (OP)

  • Posts: 84
Re: Hello World?
« Reply #7 on: March 14, 2015, 03:01:22 pm »
Thanks! That doesn't seem to change anything, though. I do have an icon.png, but it's not showing up in the "games" category. Do I have the right category name?

David Knight

  • Posts: 577
Re: Hello World?
« Reply #8 on: March 14, 2015, 06:35:07 pm »
Is your desktop file called default.gcw0.desktop and is it in the root directory of the opk?

fiver (OP)

  • Posts: 84
Re: Hello World?
« Reply #9 on: March 15, 2015, 08:16:09 am »
Is your desktop file called default.gcw0.desktop and is it in the root directory of the opk?

No, it didn't have the right name. I tried renaming it, but it still doesn't work. It is in the root directory, too.

zear

  • * Moderator
  • Posts: 2381
Re: Hello World?
« Reply #10 on: March 15, 2015, 10:54:28 am »
Have you tried to debug the issue yet?
Maybe your code simply doesn't work.

pcercuei

  • Posts: 1666
    • My devblog
Re: Hello World?
« Reply #11 on: March 15, 2015, 12:03:58 pm »
Just upload the OPK somewhere so that we can take a look.

fiver (OP)

  • Posts: 84
Re: Hello World?
« Reply #12 on: March 15, 2015, 05:16:17 pm »
Never mind. I tried putting everything together one last time, just to make sure, and it worked! Apparently, you need this line at the top of the .desktop file, too?

Code: [Select]
[Desktop Entry]

pcercuei

  • Posts: 1666
    • My devblog
Re: Hello World?
« Reply #13 on: March 15, 2015, 05:37:44 pm »
Yes, you need that line.

 

Post a new topic
Post a new topic