Updated to B28 and lost access to Context.createTexture2D

Hey, I just updated to B28 and realized that access to context was made private for some reason. I was generating a polar radar image from binary data over websockets using scene.context.createTexture2D, but I no longer have access to this function. Did it get moved somewhere else? Is the Context now accessible some other way?

Thanks.

Hi,

createTexture2D was made private in the documentation but it is still there and will continue to be there in one form or another. We removed it from the doc since it is a low-level function that may change in the future.

Patrick

Hi Patrick,

How do I access createTexture2D?

Previously I was using:
viewer.scene.context.createTexture2D({width:512, height:1024});

This no longer works in B28 because "context" is no longer available under "scene".

Thanks

Hmm. Looks like it should be there:

https://github.com/AnalyticalGraphicsInc/cesium/blob/master/Source/Scene/Scene.js#L632

Patrick

Interesting, when I try to access viewer.scene.context, it tells me that context is undefined.

If you are on b28, try _context. In master and future versions, it is context.

Patrick

Aha! That did it. I'll check if context is undefined and use _context if it is.

Thanks Patrick!

在 2014年5月22日星期四 UTC+8上午5:47:06,Patrick Cozzi写道:

If you are on b28, try _context. In master and future versions, it is context.

Patrick

Interesting, when I try to access viewer.scene.context, it tells me that context is undefined.

> Hmm. Looks like it should be there:

>

>

> https://github.com/AnalyticalGraphicsInc/cesium/blob/master/Source/Scene/Scene.js#L632

>

>

>

> Patrick

>

>

>

>

> Hi Patrick,

>

>

>

> How do I access createTexture2D?

>

>

>

> Previously I was using:

>

> viewer.scene.context.createTexture2D({width:512, height:1024});

>

>

>

> This no longer works in B28 because "context" is no longer available under "scene".

>

>

>

> Thanks

>

>

>

>

> > Hi,

>

> >

>

> >

>

> > createTexture2D was made private in the documentation but it is still there and will continue to be there in one form or another. We removed it from the doc since it is a low-level function that may change in the future.

>

>

> >

>

> >

>

> > Patrick

>

> >

>

> >

>

> > On Monday, May 19, 2014 5:51:26 PM UTC-4, skaug...@gmail.com wrote:Hey, I just updated to B28 and realized that access to context was made private for some reason. I was generating a polar radar image from binary data over websockets using scene.context.createTexture2D, but I no longer have access to this function. Did it get moved somewhere else? Is the Context now accessible some other way?

>

>

> > Thanks.

>

>

>

> --

>

> You received this message because you are subscribed to a topic in the Google Groups "cesium-dev" group.

>

> To unsubscribe from this topic, visit https://groups.google.com/d/topic/cesium-dev/4dylJA-25LM/unsubscribe.

>

> To unsubscribe from this group and all its topics, send an email to cesium-dev+...@googlegroups.com.

>

> For more options, visit https://groups.google.com/d/optout.

>

>

>

>

>

> --

>

> twitter.com/pjcozzi

--

You received this message because you are subscribed to a topic in the Google Groups "cesium-dev" group.

To unsubscribe from this topic, visit https://groups.google.com/d/topic/cesium-dev/4dylJA-25LM/unsubscribe.

To unsubscribe from this group and all its topics, send an email to cesium-dev+...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--

twitter.com/pjcozzi

Hi Patrick,
   I'm a beginner of cesium and the version I'm using is 1.12 in which I can't find the function 'viewer.scene.context'. Can you tell me some detailed descriptions of the function and how to use it in new versions?
  Thanks.

Hi Patrick,
   I'm a beginner of cesium and the version I'm using is 1.12 in which I can't find the function 'viewer.scene.context'. Can you tell me some detailed descriptions of the function and how to use it in new versions?
  Thanks.

Hi,

viewer.scene.context should be there: https://github.com/AnalyticalGraphicsInc/cesium/blob/master/Source/Scene/Scene.js#L808

However, context is marked @private meaning it is not part of the public Cesium API and may change from release to release.

Patrick