Jump to content




Surface API 1.6.2

api

61 replies to this topic

#41 CrazedProgrammer

  • Members
  • 495 posts
  • LocationWageningen, The Netherlands

Posted 12 May 2015 - 07:43 PM

I've updated the Surface API to version 1.6.0!
I've made these changes and additions to the API:
- Added surf:drawHLine and surf:drawVLine
- Added the ability to remove functions from the API code to save disk space (look at the function documentation for dependencies)
- Removed all global references (surface.*) so you can load the API as something else than "surface" or load it locally

It is also 156 bytes smaller than version 1.5.3 and the ability to remove functions can make you save up to 90% disk space.

You can download the new version from the same pastebin as before:
pastebin get 5YWfPd8Z surface
If you want to download version 1.5.3 for some reason you can still do that:
pastebin get J2Y288mW surface

#42 CrazedProgrammer

  • Members
  • 495 posts
  • LocationWageningen, The Netherlands

Posted 14 May 2015 - 12:44 PM

I've made a small fix (version 1.6.2).
The term.scroll, term.clearLine and term.setCursorBlink from surf:getTerm didn't work properly.
I've fixed it by now.
You can download version 1.6.2 from the same pastebin as before:
pastebin get 5YWfPd8Z surface

Edited by CrazedProgrammer, 14 May 2015 - 01:02 PM.


#43 syfygirl

  • Members
  • 94 posts
  • LocationSomewhere in my mind, to which only makes sense to me.

Posted 05 June 2015 - 11:47 PM

so it's almost like a simple opengl?

Edited by syfyguy13, 05 June 2015 - 11:47 PM.


#44 biggest yikes

  • Members
  • 573 posts

Posted 06 June 2015 - 12:20 AM

I must find a way to invert CraftOS now after reading the "drawSurfaceRotated" example

#45 wilcomega

  • Members
  • 466 posts
  • LocationHolland

Posted 09 June 2015 - 11:28 AM

this is really cool, i can see me using this in the future.
if its possible you should try to make a 3D rendering engine, a basic one that supports rendering faces and primitive objects like cubes,
if you want i would like to help with that part :)

anyways, i have got an idea for a system where you can use multiple monitors on one system without low level program support

#46 CrazedProgrammer

  • Members
  • 495 posts
  • LocationWageningen, The Netherlands

Posted 09 June 2015 - 04:32 PM

View Postsyfyguy13, on 05 June 2015 - 11:47 PM, said:

so it's almost like a simple opengl?
Absolutely not :P
It is more like HTML5's canvas element or SDL.

#47 CrazedProgrammer

  • Members
  • 495 posts
  • LocationWageningen, The Netherlands

Posted 09 June 2015 - 04:39 PM

View Postwilcomega, on 09 June 2015 - 11:28 AM, said:

this is really cool, i can see me using this in the future.
if its possible you should try to make a 3D rendering engine, a basic one that supports rendering faces and primitive objects like cubes,
if you want i would like to help with that part :)

anyways, i have got an idea for a system where you can use multiple monitors on one system without low level program support
Thanks!

I'm currently working on something called OpenGraphics.
It will have high-speed canvases (surfaces in the Surface API) and real perspective 3D.
You will be able to remove all functions without having to worry about function dependencies.

You can already use multiple monitors on one system by drawing parts of a surface to different monitors (see the documentation of surf:render).

#48 wilcomega

  • Members
  • 466 posts
  • LocationHolland

Posted 17 June 2015 - 06:08 PM

cant wait, from the recent tweets from dan200, we can hope for those cool icons, 3D, more MORE pixels and other cool stuff :)

#49 CrazedProgrammer

  • Members
  • 495 posts
  • LocationWageningen, The Netherlands

Posted 17 June 2015 - 06:27 PM

View Postwilcomega, on 17 June 2015 - 06:08 PM, said:

cant wait, from the recent tweets from dan200, we can hope for those cool icons, 3D, more MORE pixels and other cool stuff :)
Yeah me too :D
It would be sooooo nice to have more pixels.
The 3D part was probably for testing the triangle/polygon filling algorithm.
I doubt it will come out in the next two months.

#50 クデル

  • Members
  • 349 posts

Posted 09 July 2015 - 12:21 PM

Is there a text input function or something alike? I'm using the read function and it doesn't play nicely with the Surface API, the colours don't match so their reset to defaults which is more than painful. I can't think of a good fix either, well atleast one that wouldn't require drawing individual pixels.

#51 LeDark Lua

  • Members
  • 369 posts
  • LocationLeLua

Posted 07 August 2015 - 12:10 PM

Hey crazy, just asking if you could make a rotating text. I know you cant make upside down chars but when you are rotating you can invert text you know :D And you can make like text sideways, and that kind of stuff. Well this would be cool.

EDIT: and you could pick the center of rotating :)

EDIT2: And this is very nice, it runs sooo smooth that I cant even.

Edited by LeDark Lua, 07 August 2015 - 12:23 PM.


#52 PixelFox

  • Members
  • 106 posts

Posted 05 September 2015 - 08:53 PM

Can you make surf:invert() it inverts the surface :P

#53 CrazedProgrammer

  • Members
  • 495 posts
  • LocationWageningen, The Netherlands

Posted 06 September 2015 - 09:48 AM

View PostLightning, on 05 September 2015 - 08:53 PM, said:

Can you make surf:invert() it inverts the surface :P
I don't know what you mean by that.
If you want to draw a surface mirrored, then you can use the surf:drawSurfaceScaled function and make x1 bigger than x2 and/or y1 bigger than y2.

#54 funzrey_

  • Members
  • 6 posts

Posted 18 September 2015 - 11:41 AM

A little laggy for me (it's probably my laptop, because i normally get 10/30FPS on minecraft, and 40/70FPS on CCEmuRedux, and about 70/100 FPS on a forked version of CCLite.

#55 CrazedProgrammer

  • Members
  • 495 posts
  • LocationWageningen, The Netherlands

Posted 19 September 2015 - 04:19 PM

View Postfunzrey_, on 18 September 2015 - 11:41 AM, said:

A little laggy for me (it's probably my laptop, because i normally get 10/30FPS on minecraft, and 40/70FPS on CCEmuRedux, and about 70/100 FPS on a forked version of CCLite.
It was built with optimization in mind but I guess anything can be laggy.

#56 PixelFox

  • Members
  • 106 posts

Posted 19 September 2015 - 09:05 PM

I mean making the colors inverted. like: colors.red becomes colors.cyan

#57 LeDark Lua

  • Members
  • 369 posts
  • LocationLeLua

Posted 20 September 2015 - 06:49 AM

Or shading, like surf:shade(surf.shade.grey) and the colors change to grey and depending on the strenth it would be darker or lighter. Blue/cyan or Red/orange/pink shades is cool.

#58 CrazedProgrammer

  • Members
  • 495 posts
  • LocationWageningen, The Netherlands

Posted 23 September 2015 - 08:37 AM

View PostLightning, on 19 September 2015 - 09:05 PM, said:

I mean like the colors inverted. like: colors.red becomes colors.cyan
surf:shader(function (c, back, t) return c, 2 ^ (15 - math.log(back) / math.log(2)), 2 ^ (15 - math.log(t) / math.log(2)) end)

Edited by CrazedProgrammer, 23 September 2015 - 08:42 AM.


#59 CrazedProgrammer

  • Members
  • 495 posts
  • LocationWageningen, The Netherlands

Posted 23 September 2015 - 08:45 AM

View PostLeDark Lua, on 20 September 2015 - 06:49 AM, said:

Or shading, like surf:shade(surf.shade.grey) and the colors change to grey and depending on the strenth it would be darker or lighter. Blue/cyan or Red/orange/pink shades is cool.
You can make those shaders by yourself with surf:shader, but if there is really a demand for it I can create grayscale, sepia, higher contrast and many more built-in shaders.

#60 PixelFox

  • Members
  • 106 posts

Posted 17 October 2015 - 10:06 PM

Is there a way to Scale AND Rotate an image?





2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users