Upgrade to Scala 2.9

21 views
Skip to first unread message

Hicks, Matt

unread,
May 13, 2011, 11:38:07 AM5/13/11
to sgin...@googlegroups.com
Does anyone have any complaint to Sgine only supporting 2.9+ going forward or does anyone need compatibility with 2.8?

philip

unread,
May 22, 2011, 9:49:06 AM5/22/11
to sgine-dev
Nope! go ahead, I'm very happy. (Sgine needs a cool game to make it
more well know)

On May 13, 11:38 pm, "Hicks, Matt" <mhi...@captiveimagination.com>
wrote:

Jacob Biggs

unread,
May 22, 2011, 3:29:19 PM5/22/11
to sgin...@googlegroups.com
Once I know a bit more about the engine I will definitely attempt a game.
Working on NeHe lessons currently.

Hicks, Matt

unread,
May 22, 2011, 3:58:31 PM5/22/11
to sgin...@googlegroups.com
philip, this has already been done on the tip. :)

On Sun, May 22, 2011 at 7:49 AM, philip <phili...@gmail.com> wrote:

Hicks, Matt

unread,
May 22, 2011, 4:00:10 PM5/22/11
to sgin...@googlegroups.com
Jacob, great!  I look forward to seeing some additional lessons.  Let me know if there are missing methods that are needed.  I'm currently making some underlying changes to the generator that may change a few methods, but will introduce many additional methods that the generator was not previously picking up.  Hopefully this shouldn't affect what you're doing at all.

Jacob Biggs

unread,
May 22, 2011, 4:48:50 PM5/22/11
to sgin...@googlegroups.com
It shouldn't. One question about the repository: how do I pull the 0.1 tag and all that is in default into one clone? Or can I just download the current build and it will have everything included?

Hicks, Matt

unread,
May 22, 2011, 6:35:29 PM5/22/11
to sgin...@googlegroups.com
With Mercurial (and Git for that matter) you create a clone of the repo on your machine, so all you have to do is update to the tag "0.1" locally instead of "tip".

Jacob Biggs

unread,
May 22, 2011, 6:55:56 PM5/22/11
to sgin...@googlegroups.com
But when I do that it doesn't pull stuff without the 0.1 tag, that are in default, like the Lesson 02 you added. Is that expected behavior? Is default just bits and pieces that aren't officially part of 0.1?

Hicks, Matt

unread,
May 23, 2011, 9:08:25 AM5/23/11
to sgin...@googlegroups.com
You have to switch back and forth between tip and 0.1.  Both "tip" (the most recent commit) and "0.1" (the previous iteration of Sgine) are tags in the "default" branch.  The NeHe tutorials should go in the "tip".  Does that make sense?

philip

unread,
Jun 7, 2011, 2:40:46 PM6/7/11
to sgine-dev
Hi Matt,

I wrote some code previously which worked with 0.1, so whats the
status of the tip, it seems like something which is half done? am I
correct to say that, and I should keep with tip?

I can't see how I can convert my older code across to tip.

Regards, Phil


On May 23, 9:08 pm, "Hicks, Matt" <mhi...@captiveimagination.com>
wrote:
> You have to switch back and forth between tip and 0.1.  Both "tip" (the most
> recent commit) and "0.1" (the previous iteration of Sgine) are tags in the
> "default" branch.  The NeHe tutorials should go in the "tip".  Does that
> make sense?
>
>
>
>
>
>
>
> On Sun, May 22, 2011 at 4:55 PM, Jacob Biggs <biggs.ja...@gmail.com> wrote:
> > But when I do that it doesn't pull stuff without the 0.1 tag, that are in
> > default, like the Lesson 02 you added. Is that expected behavior? Is default
> > just bits and pieces that aren't officially part of 0.1?
>
> > On Sun, May 22, 2011 at 4:35 PM, Hicks, Matt <
> > mhi...@captiveimagination.com> wrote:
>
> >> With Mercurial (and Git for that matter) you create a clone of the repo on
> >> your machine, so all you have to do is update to the tag "0.1" locally
> >> instead of "tip".
>
> >> On Sun, May 22, 2011 at 2:48 PM, Jacob Biggs <biggs.ja...@gmail.com>wrote:
>
> >>> It shouldn't. One question about the repository: how do I pull the 0.1
> >>> tag and all that is in default into one clone? Or can I just download the
> >>> current build and it will have everything included?
>
> >>> On Sun, May 22, 2011 at 2:00 PM, Hicks, Matt <
> >>> mhi...@captiveimagination.com> wrote:
>
> >>>> Jacob, great!  I look forward to seeing some additional lessons.  Let me
> >>>> know if there are missing methods that are needed.  I'm currently making
> >>>> some underlying changes to the generator that may change a few methods, but
> >>>> will introduce many additional methods that the generator was not previously
> >>>> picking up.  Hopefully this shouldn't affect what you're doing at all.
>
> >>>> On Sun, May 22, 2011 at 1:29 PM, Jacob Biggs <biggs.ja...@gmail.com>wrote:
>
> >>>>> Once I know a bit more about the engine I will definitely attempt a
> >>>>> game.
> >>>>> Working on NeHe lessons currently.
>

Hicks, Matt

unread,
Jun 7, 2011, 2:51:19 PM6/7/11
to sgin...@googlegroups.com
Phil,

The tip is still "in-progress", so don't switch just yet...hopefully in the pretty near future you'll be able to migrate relatively easily to the new version but I'll keep you updated.

-Matt

philip

unread,
Jul 12, 2011, 6:58:03 AM7/12/11
to sgine-dev
Hi Matt,

How is the tip going? When will I be able to use tip? ... or ... could
you estimate how long it will be before its ready?

Thanks, Phil

On Jun 8, 2:51 am, "Hicks, Matt" <mhi...@captiveimagination.com>
wrote:

Hicks, Matt

unread,
Jul 12, 2011, 8:46:47 AM7/12/11
to sgin...@googlegroups.com
Phil,

I'm making fast and good progress, but still quite a bit of work left to get back to its former glory.  I am finally working on the "ui" project, which is where all the fun happens.  Properties are done, Events are done, OpenGL implementation is done, and the "render" project is done (for the first iteration).  My goal by this weekend is to have an Image component in "ui" that displays an image to the screen.  That sounds like a simple task, but there's a lot of infrastructure that I have to build to make that happen.

To display an Image on the screen should be as simple as:

object MyImage extends UI {
  this += Image("sgine.png")
}

Some of this may change before the final version, but simplicity is the goal.

The next step is to migrate in Font / Text functionality into the "ui" along with Document support.  Once all of that is done there's just a bit more work creating the additional features that 0.1 had and we should be close.

What specifically are you currently using, and what do you need?

Thanks,

Matt

philip

unread,
Jul 17, 2011, 9:56:36 AM7/17/11
to sgine-dev
Hi Matt,

How can I just create a display and put a bitmap on the screen using
the default branch? as I am used to the previous version.

I noticed you have this going to a repository, so I added the
following to my sbt.

resolvers += "scala-tools.org-nexus-public-snapshots" at "http://
nexus.scala-tools.org/content/repositories/public-snapshots"

libraryDependencies ++= Seq(
"org.sgine" % "sgine-core_2.9.0-1" % "1.0-SNAPSHOT",
"org.sgine" % "sgine-event_2.9.0-1" % "1.0-SNAPSHOT",
"org.sgine" % "sgine-render_2.9.0-1" % "1.0-SNAPSHOT",
"org.sgine" % "sgine-concurrent_2.9.0-1" % "1.0-SNAPSHOT",
"org.sgine" % "sgine-math_2.9.0-1" % "1.0-SNAPSHOT",
"org.sgine" % "sgine-property_2.9.0-1" % "1.0-SNAPSHOT"
)

Then... lost - at the moment checking out your source and looking
around.

Thanks, Phil


On Jul 12, 8:46 pm, "Hicks, Matt" <mhi...@captiveimagination.com>
wrote:

Hicks, Matt

unread,
Jul 17, 2011, 10:09:38 AM7/17/11
to sgin...@googlegroups.com
Phil,

You should only need "org.sgine" %% "sgine-ui" % "1.0-SNAPSHOT" if you're running 2.9.0.1 for your project.  That dependency will pick up all the other requirements for you.

Then, if you take a look at the latest post on Sgine you can see how simple it is to display an image to the screen now:

http://www.sgine.org/2011/07/more-concise-and-more-powerful.html

The only thing you might still need is the JNI libraries for LWJGL to get your application to run....I'm hoping to create a layer that will introduce these if not already visible.

Let me know if you have any trouble.

-Matt

philip

unread,
Jul 18, 2011, 8:24:21 AM7/18/11
to sgine-dev
Hi Matt,

I tried that but it didn't work.

is this the resolver I am supposed to use?
val sgineResolver = "scala-tools.org-nexus-public-snapshots" at
"http://nexus.scala-tools.org/content/repositories/public-snapshots/"

The following works with this resolver.
val sgine1 = "org.sgine" % "sgine-core_2.9.0-1" % "1.0-SNAPSHOT"
val sgine2 = "org.sgine" % "sgine-event_2.9.0-1" % "1.0-SNAPSHOT"
val sgine3 = "org.sgine" % "sgine-render_2.9.0-1" % "1.0-SNAPSHOT"
val sgine4 = "org.sgine" % "sgine-concurrent_2.9.0-1" % "1.0-
SNAPSHOT"
val sgine5 = "org.sgine" % "sgine-math_2.9.0-1" % "1.0-SNAPSHOT"
val sgine6 = "org.sgine" % "sgine-property_2.9.0-1" % "1.0-SNAPSHOT"

but
val sgine7 = "org.sgine" %% "sgine-ui" % "1.0-SNAPSHOT"

does not

[error] {file:/C:/home/projects/akkademo/}AkkaDemo/*:update:
sbt.ResolveException: unresolved dependency: org.sgine#sgine-
ui_2.9.0-1;1.0-SNAPSHOT: not found
[error] Total time: 10 s, completed 18/07/2011 8:24:22 PM

Thanks!

On Jul 17, 10:09 pm, "Hicks, Matt" <mhi...@captiveimagination.com>
wrote:
> Phil,
>

Hicks, Matt

unread,
Jul 18, 2011, 9:35:47 AM7/18/11
to sgin...@googlegroups.com
Hmmm, perhaps you are just running 2.9.0?

try val sgine7 = "org.sgine" % "sgine-ui_2.9.0-1" % "1.0-SNAPSHOT" and see if that works

philip

unread,
Jul 18, 2011, 10:14:03 AM7/18/11
to sgine-dev
Hi Matt,

My build settings:
val buildScalaVersion = "2.9.0-1"
val buildVersion = "1.0-SNAPSHOT"

val buildSettings = Defaults.defaultSettings ++
Seq (
organization := buildOrganization,
scalaVersion := buildScalaVersion,
version := buildVersion,
parallelExecution := false,
//retrieveManaged := true,
moduleConfigurations ++=
Resolvers.moduleConfigurations,
javacOptions ++= Seq("-Xlint:unchecked"),
scalacOptions ++= Seq("-deprecation", "-
unchecked", "-Xcheckinit", "-encoding", "utf8")
)

lazy val root = Project ("AkkaDemo", file("."), settings =
buildSettings ++ Seq (
libraryDependencies := web ))

> update
[info] Updating {file:/C:/home/projects/akkademo/}AkkaDemo...
[warn] module not found: org.sgine#sgine-ui_2.9.0-1;1.0-SNAPSHOT
[warn] ==== scala-tools.org-nexus-public-snapshots: tried
[warn]
http://nexus.scala-tools.org/content/repositories/public-snapshots/org/sgine/sgine-ui_2.9.0-1/1.0-SNAPSHOT/sgine-ui_2.9.0-1-1.0-SNAPSHOT.pom
[warn] -- artifact org.sgine#sgine-ui_2.9.0-1;1.0-SNAPSHOT!sgine-
ui_2.9.0-1.jar:
[warn]
http://nexus.scala-tools.org/content/repositories/public-snapshots/org/sgine/sgine-ui_2.9.0-1/1.0-SNAPSHOT/sgine-ui_2.9.0-1-1.0-SNAPSHOT.jar
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: UNRESOLVED DEPENDENCIES ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: org.sgine#sgine-ui_2.9.0-1;1.0-SNAPSHOT: not found
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[info]
[warn] :: problems summary ::
[warn] :::: WARNINGS
[warn] module not found: org.sgine#sgine-ui_2.9.0-1;1.0-SNAPSHOT
[warn] ==== scala-tools.org-nexus-public-snapshots: tried
[warn]
http://nexus.scala-tools.org/content/repositories/public-snapshots/org/sgine/sgine-ui_2.9.0-1/1.0-SNAPSHOT/sgine-ui_2.9.0-1-1.0-SNAPSHOT.pom
[warn] -- artifact org.sgine#sgine-ui_2.9.0-1;1.0-SNAPSHOT!sgine-
ui_2.9.0-1.jar:
[warn]
http://nexus.scala-tools.org/content/repositories/public-snapshots/org/sgine/sgine-ui_2.9.0-1/1.0-SNAPSHOT/sgine-ui_2.9.0-1-1.0-SNAPSHOT.jar
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: UNRESOLVED DEPENDENCIES ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: org.sgine#sgine-ui_2.9.0-1;1.0-SNAPSHOT: not found
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[info]
[info] :: USE VERBOSE OR DEBUG MESSAGE LEVEL FOR MORE DETAILS
[error] {file:/C:/home/projects/akkademo/}AkkaDemo/*:update:
sbt.ResolveException: unresolved dependency: org.sgine#sgine-
ui_2.9.0-1;1.0-SNAPSHOT: not found
[error] Total time: 10 s, completed 18/07/2011 10:11:57 PM
>



On Jul 18, 9:35 pm, "Hicks, Matt" <mhi...@captiveimagination.com>
wrote:

Hicks, Matt

unread,
Jul 18, 2011, 10:24:21 AM7/18/11
to sgin...@googlegroups.com
Doh!

I just realized that I never added "ui" to my root dependencies so it doesn't get built and published automatically by Jenkins.  Sorry about that...I'll get that updated tonight.

philip

unread,
Jul 18, 2011, 10:28:13 AM7/18/11
to sgine-dev
No problem, I also had to add PNGDecoder.jar to my project and a repo
for val lwjglRepo = "lwjgl" at "http://adterrasperaspera.com/lwjgl"

On Jul 18, 10:24 pm, "Hicks, Matt" <mhi...@captiveimagination.com>
wrote:
> >http://nexus.scala-tools.org/content/repositories/public-snapshots/or...
> > [warn]   -- artifact org.sgine#sgine-ui_2.9.0-1;1.0-SNAPSHOT!sgine-
> > ui_2.9.0-1.jar:
> > [warn]
>
> >http://nexus.scala-tools.org/content/repositories/public-snapshots/or...
> > [warn]  ::::::::::::::::::::::::::::::::::::::::::::::
> > [warn]  ::          UNRESOLVED DEPENDENCIES         ::
> > [warn]  ::::::::::::::::::::::::::::::::::::::::::::::
> > [warn]  :: org.sgine#sgine-ui_2.9.0-1;1.0-SNAPSHOT: not found
> > [warn]  ::::::::::::::::::::::::::::::::::::::::::::::
> > [info]
> > [warn] :: problems summary ::
> > [warn] :::: WARNINGS
> > [warn]          module not found: org.sgine#sgine-ui_2.9.0-1;1.0-SNAPSHOT
> > [warn]  ==== scala-tools.org-nexus-public-snapshots: tried
> > [warn]
>
> >http://nexus.scala-tools.org/content/repositories/public-snapshots/or...
> > [warn]    -- artifact org.sgine#sgine-ui_2.9.0-1;1.0-SNAPSHOT!sgine-
> > ui_2.9.0-1.jar:
> > [warn]
>
> >http://nexus.scala-tools.org/content/repositories/public-snapshots/or...
> ...
>
> read more »

Hicks, Matt

unread,
Jul 18, 2011, 10:40:55 AM7/18/11
to sgin...@googlegroups.com
Hmmm, I would think that LWJGL should have been implicitly included.  I'll have to look into that.

As for PNGDecoder I need to figure out how to bundle dependencies that are not published by their creators.

philip

unread,
Jul 20, 2011, 12:41:09 AM7/20/11
to sgine-dev
Hi Matt,

I see you pushed the UI to the snapshot, thanks, now I was trying to
do a StandardDisplay as in.

object TestImage extends StandardDisplay {
def setup() = {
val component = new Image(Resource("puppies.jpg"))
scene += component
}
}

It seems your StandardDisplay is missing from the main default, but I
can see a StandardDisplay in the 0.1
http://code.google.com/p/sgine/source/browse/src/main/scala/org/sgine/render/?name=0.1

Or am I supposed to use RenderApplication?
Thanks, Phil

On Jul 18, 10:40 pm, "Hicks, Matt" <mhi...@captiveimagination.com>
wrote:
> ...
>
> read more »

Hicks, Matt

unread,
Jul 20, 2011, 9:20:20 AM7/20/11
to sgin...@googlegroups.com
To replicate that in the tip:

object TestImage extends UI {
  contents += Image("puppies.jpg")
}

although I'm not sure it will work for JPGs at the moment.  I have direct support for PNG, but need to implement ImageIO fallback for others.

philip

unread,
Jul 20, 2011, 9:50:44 AM7/20/11
to sgine-dev
Hi Matt,

Great!

For pixel perfect rendering I do the following.

object BrowserView extends UI {
Resource.addPath(".", FileResourceFinder)
contents += Image("result2.png")

override def resolution(width: Double, height: Double) = {
val scale = 171.5 / height
this.scale(scale)
position.z := -200.0
matrixHierarchy := false
}
}

Well, I think its not totally perfect, sometimes if I position the
image at the wrong MOD 2 position in the y direction it renders blur,
well it used to. Anyway, its close.

Phil

On Jul 20, 9:20 pm, "Hicks, Matt" <mhi...@captiveimagination.com>
wrote:
> To replicate that in the tip:
>
> object TestImage extends UI {
>   contents += Image("puppies.jpg")
>
> }
>
> although I'm not sure it will work for JPGs at the moment.  I have direct
> support for PNG, but need to implement ImageIO fallback for others.
>
>
>
>
>
>
>
> On Tue, Jul 19, 2011 at 10:41 PM, philip <philip14...@gmail.com> wrote:
> > Hi Matt,
>
> > I see you pushed the UI to the snapshot, thanks, now I was trying to
> > do a StandardDisplay as in.
>
> > object TestImage extends StandardDisplay {
> >  def setup() = {
> >  val component = new Image(Resource("puppies.jpg"))
> >  scene += component
> >  }
> > }
>
> > It seems your StandardDisplay is missing from the main default, but I
> > can see a StandardDisplay in the 0.1
>
> >http://code.google.com/p/sgine/source/browse/src/main/scala/org/sgine...
> ...
>
> read more »

Hicks, Matt

unread,
Jul 20, 2011, 12:15:28 PM7/20/11
to sgin...@googlegroups.com
That seems to work better than this?

http://code.google.com/p/sgine/source/browse/ui/src/main/scala/org/sgine/ui/TranslationMatrixComponent.scala#71

Tonight I'll give it a try and do some verification.

philip

unread,
Jul 20, 2011, 11:40:50 PM7/20/11
to sgine-dev
Hi Matt, yes ... could it be some difference between graphics cards?
Anyway my version gives pixel perfect resolution at 171.5 / height
scale.

On Jul 21, 12:15 am, "Hicks, Matt" <mhi...@captiveimagination.com>
wrote:
> That seems to work better than this?
>
> http://code.google.com/p/sgine/source/browse/ui/src/main/scala/org/sg...
> ...
>
> read more »

Hicks, Matt

unread,
Jul 21, 2011, 9:38:26 AM7/21/11
to sgin...@googlegroups.com
Not sure...try running the ResolutionTest and tell me how it looks both ways.

philip

unread,
Jul 21, 2011, 11:27:57 PM7/21/11
to sgine-dev

It seems difficult to maximize the awt frame.


On Jul 21, 12:15 am, "Hicks, Matt" <mhi...@captiveimagination.com>
wrote:
> That seems to work better than this?
>
> http://code.google.com/p/sgine/source/browse/ui/src/main/scala/org/sg...
> ...
>
> read more »

Hicks, Matt

unread,
Jul 22, 2011, 9:51:49 AM7/22/11
to sgin...@googlegroups.com
Yeah...I haven't added support for fullscreen or window resizing yet...it's lower on my TODO list.  This weekend I'm hoping to finish mouse and keyboard support along with the camera.

Next week I'll hopefully get to window resizing and fullscreen.

Hicks, Matt

unread,
Jul 23, 2011, 10:46:05 AM7/23/11
to sgin...@googlegroups.com
Philip,

I think the reason you're seeing 171.5 as better is because it fills the width.  That isn't actually correct considering the aspect ratio is off in the current window.  The window size is 1024x768, which makes the inner content smaller and because of the title of the window the vertical area is reduced. I'm planning on modifiying the window creation to allow you to specify the exact inner size of the frame rather than outter, but haven't gotten around to that yet.

Also, once you can render fullscreen this will be more apparent.

Hope that helps,

Matt

On Wed, Jul 20, 2011 at 9:40 PM, philip <phili...@gmail.com> wrote:

philip

unread,
Apr 6, 2012, 11:46:58 PM4/6/12
to sgin...@googlegroups.com
Hi Matt,

Just back using Sgine.

Nice to see that it shows the image at the correct scale for 2D now when I do this:
object TestUI extends UI
{
  override def width = 1680
  override def height = 930
  contents += Image("puppies.png")
}

Also note that it doesn't work with JDK 1.7 on OSX, but I think thats not your fault, its either the JDK problem or the library you are using.

Have you seen this project? http://code.google.com/p/scage/

Phil


On Monday, May 23, 2011 3:58:31 AM UTC+8, Matt Hicks wrote:
philip, this has already been done on the tip. :)

On Sun, May 22, 2011 at 7:49 AM, philip <phili...@gmail.com> wrote:
Nope! go ahead, I'm very happy. (Sgine needs a cool game to make it
more well know)

On May 13, 11:38 pm, "Hicks, Matt" <mhi...@captiveimagination.com>

Hicks, Matt

unread,
Apr 7, 2012, 9:11:49 AM4/7/12
to sgin...@googlegroups.com
Phil,

Now it defaults to orthographic. If you use perspective and set the
resolution on a container you can get the same benefit in 3d.

See this example:
http://code.google.com/p/sgine/source/browse/ui/src/test/scala/org/sgine/ui/ResolutionExample.scala

I don't have a Mac anymore, so if you can do some digging to determine
why it isn't working I'd be happy to make the fix ASAP.

As for Scage I hadn't heard of it. Seems like an interesting little
project, but honestly not too different from the Java variations.

Nice to hear from you,

Matt

Reply all
Reply to author
Forward
0 new messages