| Если выбирать из этих друх, то лично я бы выбрал Pure. Тем более что в версии 5.00 добавили много функций в 3D движок.
200?'200px':''+(this.scrollHeight+5)+'px');"> - Added: Cocoa support on OS X (now the default toolkit) - Added: 64-bit version of PureBasic for OS X - Added: Brand new Form Designer, for Windows, Linux and OS X - Added: Carbon subsystem for PowerPC and x86 version of PureBasic (use 'carbon' as subsystem to enable it) - Added: Multi-dimensional arrays in structure support - Added: InitScintilla() on Linux and OS X avoid compilation issues (empty function) - Added: #PB_Window_NoActivate flag to OpenWindow() and HideWindow() - Added: #PB_EventType_RightClick support ScintillaGadget() - Added: Favorites section to the explorer tool (IDE) - Added: Trigger for custom tools when a new source file is created (IDE) - Added: SetWindowCallback() support to OS X to have callback events (only a few type supported: #PB_Event_SizeWindow, Splitter, ScrollBar) - Added: partial thread-safety to GTK (Linux) - Added: SpritePixelCollision() support for OS X and Linux
- Changed: SetModulePosition() is now in milliseconds, no more in pattern
- Updated: Scintilla updated to 3.1.0 - Updated: Expat updated to 2.1.0 - Updated: libjpeg updated to 8.0d - Updated: libpng updated to 1.5.12 - Updated: Ogre to 1.8.0, bullet to 2.80, hydrax to 0.5.4, CEGUI to 0.7.7 - Updated: ModPlug lib update to 0.8.8.4 - Updated: Use of VC++ 2010 instead of VC++ 2005 to compile the Windows libraries (32-bit and 64-bit), resulting of better optimized code
Engine3D: --------- Added: a new optional parameter to InitEngine3D() with constants #PB_Engine3D_DebugLog and #PB_Engine3D_DebugOutput Added: RayPick(x, y, z, x2, y2, z2 [, PickMask]) ; Returns the first #Entity crossed by the ray Added: 'PickMask' parameter to MousePick()
World: ------ Added: RenderWorld() now returns 'TimeSinceLastFrame', in milliseconds Added: SkyBox() and SkyDome() now supports Fog() Added: 'Color' and 'TextureSize' parameters to WorldShadows() Added: #PB_World_UnderWater and #PB_World_WaterGodRays flags to CreateWater()
Camera: ------ Added: CameraViewWidth(#Camera) ; return camera width in pixels Added: CameraViewHeight(#Camera) ; return camera height in pixels Added: CameraViewX(#Camera) ; return Y position in pixels Added: CameraViewY(#Camera) ; return X position in pixels Added: CameraDirection(#Camera, x, y, z) ; change the direction Added: CameraDirectionX/Y/Z(#Camera) - Retrieve the direction of the #Camera. Added: new 'IsActive' optional parameter to render to texture for CreateCamera() Added: SetCameraFixedYawAxis(#Camera, Mode [VectorX, VectorY, VectorZ]) - Change the way the yaw axis is managed Changed: CameraLookAt() ; doesn't change the direction anymore
Material: --------- Added: ScaleMaterial(#Material, x, y) Added: MaterialFog(#Material, Color, Intensity, StartDistance, EndDistance) - Display a fog effect on the material Added: ReloadMaterial(MaterialName$, Filename$, ParseScript) Added: ResetMaterial(ObjectType) Added: #PB_Material_Anisotropic support to MaterialFilteringMode() and #PB_Default support as Material to set the default settings for materials. Added: #PB_Material_Wireframe, #PB_Material_Point and #PB_Material_Solid to MaterialShadingMode()
Node: ----- Added: NodeFixedYawAxis()
Sound3D: -------- Added: SoundListenerLocate() ; to move the sound listener (the ear) in the world
Entity: ------- Added: new 'PickMask' optional paramater for CreateEntity() Added: #PB_Entity_Wireframe, #PB_Entity_Solid, #PB_Entity_Point and #PB_Entity_DisplaySkeleton to EntityRenderMode() Added: FreeEntityJoints(#Entity) - Free all joints associated with the #Entity. Added: AttachEntityObject(#Entity, Bone$, ObjectID [, x, y, z, Pitch, Roll, Yaw]) - Attach an object to the #Entity. Added: DetachEntityObject(#Entity, ObjectID) - Detach the object from the #Entity. Added: EntityBoneX/Y/Z(entityID, Bone$ [, OffsetX, OffsetY, OffsetZ]) Added: EntityBonePitch() Added: EntityBoneRoll() Added: EntityBoneYaw() Added: DirectionX/Y/Z optional parameters to EntityLookAt() Added: EntityVelocity(#Entity, x, y, z) - Change the linear velocity of the #Entity. Added: EntityAngularFactor(#Entity, x, y, z) - Change the angular factor of the #Entity. Added: EntityLinearFactor(#Entity, x, y, z) - Change the linear factor of the #Entity. Added: EntityCustomParameter(#Entity, SubEntityIndex, ParameterIndex, Value1, Value2, Value3, Value4) - Set a custom parameter to the #Entity shader script. Added: EntityParentNode(#Entity) Added: EntityBoundingBoxX/Y/Z(#Entity, Point, Flags) Added: DisableEntityBody(#Entity, Disable) Added: to Get/SetEntityAttributes: #PB_Entity_VelocityX: Get #PB_Entity_VelocityY: Get #PB_Entity_VelocityZ: Get #PB_Entity_MassCenterX: Get/Set #PB_Entity_MassCenterY: Get/Set #PB_Entity_MassCenterZ: Get/Set #PB_Entity_MaxVelocity: Get/Set
EntityAnimation: ---------------- Added: AddEntityAnimationTime(#Entity, Animation$, Time) - Add time to the specified #Entity animation. Added: EnableEntityAnimation(#Entity, Animation$, Enable [, Loop]) - Enable the specified #Entity animation. Added: EntityAnimationStatus(#Entity, Animation$) - Return the specified #Entity animation status (constants: #PB_EntityAnimation_Stopped, #PB_EntityAnimation_Started, #PB_EntityAnimation_Unknown) Added: EntityAnimationBlendMode(#Entity, Mode) - with #PB_Entity_Average and #PB_Entity_Cumulative Added: GetEntityAnimationTime(#Entity, Animation$) - Get the current #Entity animation time. Added: SetEntityAnimationTime(#Entity, Animation$, Time) - Set the current #Entity animation time. Added: GetEntityAnimationWeight(#Entity, Animation$) - Get the #Entity animation weight. Added: SetEntityAnimationWeight(#Entity, Animation$, Weight) - Set the #Entity animation weight (useful for EntityAnimationBlendMode()). Added: GetEntityAnimationLength(#Entity, Animation$) - Get the #Entity animation length. Added: SetEntityAnimationLength(#Entity, Animation$, Length) - Set the #Entity animation length. Added: UpdateEntityAnimation(#Entity, Animation$) - Update the animation, especially after vertex changes
Node: ----- Change: Attach/DetachNodeObject() removed the 'type' object Added: NodeLookAt(): Optional DirectionX/Y/Z parameter
NodeAnimation ------------- Added: FreeNodeAnimation(#NodeAnimation) - Free the specified #NodeAnimation. Added: CreateNodeAnimation(#NodeAnimation, Length, Interpolation, RotationInterpolation) - Create a new #NodeAnimation. 'Interpolation' can be: #PB_NodeAnimation_Linear or #PB_NodeAnimation_Spline 'RotationInterpolation' can be #PB_NodeAnimation_LinearRotation or #PB_NodeAnimation_SphericalRotation Added: CreateNodeAnimationTrack(#NodeAnimation, Index, NodeID) - Create a new track for the #NodeAnimation. Added: CreateNodeAnimationKeyFrame(#NodeAnimation, Track, Time, x, y, z) - Create a new keyframe for the #NodeAnimation track. Added: GetNodeAnimationKeyFrameTime(#NodeAnimation, Track, KeyFrame) - Get the keyframe time for the #NodeAnimation track. Added: SetNodeAnimationKeyFramePosition(#NodeAnimation, Track, KeyFrame, x, y, z) - Set the keyframe position for the #NodeAnimation track. Added: GetNodeAnimationKeyFrameX(#NodeAnimation, Track, KeyFrame) - Get the x keyframe position for the #NodeAnimation track. Added: GetNodeAnimationKeyFrameY(#NodeAnimation, Track, KeyFrame) - Get the y keyframe position for the #NodeAnimation track. Added: GetNodeAnimationKeyFrameZ(#NodeAnimation, Track, KeyFrame) - Get the z keyframe position for the #NodeAnimation track. Added: SetNodeAnimationKeyFrameRotation(#NodeAnimation, Track, KeyFrame, Pitch, Yaw, Roll) - Set the keyframe position for the #NodeAnimation track. Added: GetNodeAnimationKeyFramePitch(#NodeAnimation, Track, KeyFrame) - Get the keyframe pitch for the #NodeAnimation track. Added: GetNodeAnimationKeyFrameYaw(#NodeAnimation, Track, KeyFrame) - Get the y keyframe yaw for the #NodeAnimation track. Added: GetNodeAnimationKeyFrameRoll(#NodeAnimation, Track, KeyFrame) - Get the z keyframe roll for the #NodeAnimation track. Added: SetNodeAnimationKeyFrameScale(#NodeAnimation, Track, KeyFrame, ScaleX, ScaleY, ScaleZ) - Set the keyframe scale for the #NodeAnimation track. Added: AddNodeAnimationTime(#NodeAnimation, Time) - Add time to the specified #NodeAnimation. Added: EnableNodeAnimation(#NodeAnimation, Enable [, Loop]) - Enable the specified #NodeAnimation. Added: NodeAnimationStatus(#NodeAnimation) - Return the specified #NodeAnimation status. Added: GetNodeAnimationTime(#NodeAnimation) - Get the current #NodeAnimation time. Added: SetNodeAnimationTime(#NodeAnimation, Time) - Set the current #NodeAnimation time. Added: GetNodeAnimationWeight(#NodeAnimation) - Get the #NodeAnimation weight. Added: SetNodeAnimationWeight(#NodeAnimation, Weight) - Set the #NodeAnimation weight. Added: GetNodeAnimationLength(#NodeAnimation) - Get the #NodeAnimation length. Added: SetNodeAnimationLength(#NodeAnimation, Length) - Set the #NodeAnimation length.
Light: ------ Added: LightAttenuation(#Light, Range, Constant, Linear, Quadratic) Added: LightX(#Light) Added: LightY(#Light) Added: LightZ(#Light) Added: LightDirection(#Light, x, y, z) Added: LightDirectionX(#Light) Added: LightDirectionY(#Light) Added: LightDirectionZ(#Light) Added: RotateLight(#Light, Pitch, Yaw, Roll [, Flags]) Added: LightPitch(#Light) Added: LightYaw(#Light) Added: LightRoll(#Light)
Particule: ---------- Added: GetScriptParticle(#ParticleEmitter, Name$) - Get a particule emitter defined in scripts files.
Texture: -------- Added: CreateRenderTexture(#Texture, CameraID, Width, Height, RenderedTextureName$ [, Flags]) - Create a new rendered based #Texture. Flags can be: #PB_Texture_ManualUpdate or PB_Texture_AutomaticUpdate (default) Added: UpdateRenderTexture(#Texture) ; update the rendered texture, only in manual mode Added: SaveRenderTexture(#Texture, Filename$) Added: CreateCubeMapTexture(#Texture, CameraID, Width, Height, RenderedTextureName$ [, Flags]) - Create a new rendered based #Texture. Added: EntityCubeMapTexture(#Texture, #Entity) - Apply the cube map #Texture to the #Entity. Updated: CreateTexture() now handle alpha textures as well
Effect: ------- Updated: HideEffect(integer effectID, int hidden) ; now handle ribbon as well Added: EffectID(#Effect) Changed: CreateRibbonEffect() - 'InitialWidth' parameter has been removed Added: RibbonEffectWidth(#Effect, ChainIndex, Width, FadeoutWidth) Added: AttachRibbonEffect(#Effect, NodeID) - Attach the ribbon #Effect to the node. Added: DetachRibbonEffect(#Effect, NodeID) - Detach the node from the ribbon #Effect. Added: CreateLensFlareEffect(#Effect, CameraID, NodeID, BurstSize, HaloSize, HaloMaterialID, CircleMaterialID, BurstMaterialID) - Create a new lens flare #Effect. Added: LensFlareEffectColor(#Effect, ColorType, Color) - Change the color of the specified lens flare part.
Joint: ------ Added: EnableHingeJointAngularMotor(#Joint, Enable, TargetVelocity, MaxMotorImpulse) - Enable the angular motor on the hinge #Joint. Modified: Modification de la lib Joint pour supprimer la limitation d'un joint par entity: - Ajout d'un paramètre #Joint pour les fonctions suivantes : ConeTwistJoint(), HingeJoint(), PointJoint(), SliderJoint() - Remplacement du paramètre #Entity par le paramètre #Joint dans les fonctions suivantes : FreeJoint() Added: #PB_HingeJoint_LowerLimit and #PB_HingeJoint_UpperLimit to Get/SetJointAttribute()
VertexAnimation: ----------------- Added: CreateVertexAnimation(#Mesh, Animation$, Length) - Create a new vertex animation for the #mesh. Added: CreateVertexTrack(#Mesh, Animation$, Index) - Create a new track to the #Mesh animation. Added: CreateVertexPoseKeyFrame(#Mesh, Animation$, Track, Time) - Create a new keyframe to the #Mesh track. Added: AddVertexPoseReference(#Mesh, Animation$, Track, Index, PoseIndex, Influence) - Add a new vertex pose reference to the #Mesh track. Added: UpdateVertexPoseReference(#Mesh, Animation$, Track, Index, PoseIndex, Influence) - Update a new vertex pose reference to the #Mesh track. Added: VertexPoseReferencesSize(#Mesh, Animation$, Track, Index) - Return the vertex pose reference size of the specified #Mesh track. Added: MeshPoseName(#Mesh, PoseIndex) - Return the mesh pose name.
StaticGeometry: --------------- Added: Optional 'Pitch', 'Yaw', 'Roll' parameters to AddStaticGeometryEntity()
Spline: ------- CreateSpline(#Spline) - Create a new empty #Spline FreeSpline(#Spline) - Free the #Spline. AddSplinePoint(#Spline, x, y, z) ClearSpline(#Spline) - Clear the #Spine. CountSplinePoints(#Spline) - Return the number of point in the #Spine. SplinePointX(#Spline, Index) - Return the x position of the #Spline point. SplinePointY(#Spline, Index) - Return the y position of the #Spline point. SplinePointZ(#Spline, Index) - Return the z position of the #Spline point. UpdateSplinePoint(#Spline, Index, x, y, z) - Update the specified #Spline point. ComputeSpline(#Spline, Time) - Compute the #Spline at the given time. SplineX(#Spline) - Return the x position of the #Spline. SplineY(#Spline) - Return the y position of the #Spline. SplineZ(#Spline) - Return the z position of the #Spline.
Terrain: -------- FreeTerrain(#Terrain) - Free the #Terrain. SetupTerrains(LigthID, Distance, Flags) - Setup the default options for all terrains. CreateTerrain(#Terrain, Size, WorldSize, Scale, Layer, Filename$, Extension$) - Create a new #Terrain. TerrainPhysicBody(#Terrain, Restitution, Friction) - Add a static physic body to the #Terrain. DefineTerrainTile(#Terrain, TileX, TileY, Heightname$, FlipX, FlipY) - Defines a new #Terrain tile. AddTerrainTexture(#Terrain, Layer, WorldSize, DiffuseSpecular$, NormalHeight$) - Add a texture to the #Terrain. BuildTerrain(#Terrain) - Construct the #Terrain. TerrainLocate(#Terrain, x, y, z) - Change the #Terrain location. TerrainHeight(#Terrain, x, z) - Return the height of the #Terrain at the specified coordinates. TerrainTileHeightAtPosition(#Terrain, TileX, TileY, Layer, x, y) - Return the height of the #Terrain tile. TerrainTilePointX(#Terrain, TileX, TileY, x, y, z) - Return the x position in the #Terrain tile of the point. TerrainTilePointY(#Terrain, TileX, TileY, x, y, z) - Return the y position in the #Terrain tile of the point. TerrainTileSize(#Terrain, TileX, TileY) - Return the size of the #Terrain tile. GetTerrainTileHeightAtPoint(#Terrain, TileX, TileY, x, y) - Get the height of the #Terrain tile at the specified position. SetTerrainTileHeightAtPoint(#Terrain, TileX, TileY, x, y, Height) - Set the height of the #Terrain tile at the specified position. UpdateTerrain(#Terrain) - Update the whole #Terrain. TerrainTileLayerMapSize(#Terrain, TileX, TileY) - Return the #Terrain tile layer map size. GetTerrainTileLayerBlend(#Terrain, TileX, TileY, Layer, x, y) - Get the #Terrain tile layer blend value. SetTerrainTileLayerBlend(#Terrain, TileX, TileY, Layer, x, y, Value) - Set the #Terrain tile layer blend value. UpdateTerrainTileLayerBlend(#Terrain, TileX, TileY, Layer) - Update the #Terrain tile blend value. TerrainMousePick(#Terrain, CameraID, x, y) - Perform a mouse picking on the #Terrain. SaveTerrain(#Terrain, ModifiedOnly) - Save the #Terrain on disk. TerrainRenderMode(#Terrain, Flags) - Change the #Terrain render mode.
Window3D: --------- InputEvent3D(): Added a special key parameter to handle non printable keys
Obsolete: --------- Removed: AnimateEntity() (replaced with Start/StopEntityAnimation()) Removed: #PB_Entity_Wireframe, #PB_Entity_Point and #PB_Entity_Solid to EntityRenderMode() Removed: CheckEntityCollision(), NextWorldCollision(), FirstWorldCollisionEntity(), SecondWorldCollisionEntity()
PureBasic является нативным 32-разрядным и 64-разрядным языком программирования на основе установленных правил BASIC. Ключевыми особенностями PureBasic являются: портативность (Windows, Linux и MacOS X в настоящее время поддерживаются), хорошая производительность и большая оптимизация программных файлов, а так же очень простой BASIC синтаксис. PureBasic был создан как для новичков, так и для экспертов.
Несмотря на простой синтаксис, PureBasic обладает большим функционалом, таким, как указатели, структуры, процедуры, динамически связанные списки и многое другое. Опытные программисты не будут иметь никаких проблем с получением доступа к любой из легальных конструкций ОС или объектам API и PureBasic также позволяет встраивать ASM код.
Содержание
История
Примерно в это же время IBM PowerPC процессоры на базе Amiga начали появляться и стали мощной альтернативой процессорам Motorola 68000. Они были очень быстрыми и продавались по сравнительно дешевой цене, даже если сравнивать с высококлассным 68060 процессором. С приходом этих чипов люди хотели получить новую версию Blitz, т.к. ранее она была очень популярной, но её развитие для платформы Amiga была приостановлена в пользу процессоров на базе Intel x86. В итоге был представлен BlitzBasic, который был логической заменой Blitz и также имел полную поддержку процессоров 680x0 и PowerPC.
Первая версия PureBasic первоначально была выпущена для Amiga и (даже если она был плохо проверена на баги) имела интегрированную и полностью кроссплатформенный редактор, интегрированный отладчик и огромное количество внутренних установок которые, как вы уже догадались, брались непосредственно из Blitz пакета бывших "NCS". Помимо отладки и исправления багов в своём компиляторе Фред также изучал другие языки программирования, чтобы дать своей фирме возможность развиваться в других направлениях и позволить принимать более обоснованные решения о внутреннем устройстве и направлениях развития PureBasic в будущем. В течение четвертого года изучения Фредом информатики, Amiga начали считать мертвой платформой и многие сокурсники Фреда предлагали ему переключиться на Windows. Фред, конечно же, защищал себя, говоря, что сделать это проще простого, но ему всё же ещё предстояло всем это доказать.
Философия разработки
Философия развития PureBasic немного отличается от других языков во многих отношениях. Вот список некоторых из целей и политик развития PureBasic.
- После первоначальной покупки лицензии PureBasic, все последующие обновления бесплатны на всю жизнь.
- Все программы, собранные с помощью PureBasic могут быть проданы без каких-либо дополнительных расходов.
- Все программы должны быть минимального размера и не раздувать размер исполняемого файла.
- Все скомпилированные программы не должны полагаться на что-то стороннее и должны запускаться на любых машинах.
Приведенный выше перечень правил очень сильно отличается от философии других компаний. Можете ли вы представить Microsoft, который даёт вам бесплатные обновления VB.NET на всю жизнь? Философия развития PureBasic является одной из тех вещей, которая позволяет комфортно программировать и использовать её функционал. Всё это позволяет людям создать программное обеспечение, в котором они нуждаются. Обновления заключаются не только в исправлении багов, но и в усовершенствовании функционала и в добавлении новых возможностей.
Примеры программ
Давайте рассмотрим небольшой пример, чтобы показать всё в действии. Введите именно это:
После запуска этой маленькой программы она откроет окно консоли, а затем выведет строку текста в нём, информирующее пользователя о том, что для выхода он или она должны нажать "Enter". После ввода клавиши мы завершаем программу Если вы поместите мигающий курсор IDE на любое ключевое слово, которое используется в этой программе, а затем нажмёте 'F1', то появится HelpFile, описывающий это ключевое слово. Например, поместите мигающий курсор в любом месте в пределах OpenConsole () и нажмите F1 .
Ниже приведен пример, показывающий создание всех типов переменных с использованием PureBasic:
Типы данных
PureBasic предоставляет семь числовых типов данных для использования в программировании, каждый из которых использует разное количество оперативной памяти и все они имеют различные числовые пределы.
Тип | Byte | Char (Ascii) | Char (Unicode) | Word | Long | Quad | Float | Double | Суффикс | .b | .c | .c | .w | .l | .q | .f | .d | Использование памяти (RAM) | 1 байт (8 бит) | 1 байт (8 бит) | 2 байта (16 бит) | 2 байта (16 бит) | 4 байта (32 бита) | 8 байт (64 бита) | 4 байта (32 бита) | 8 байт (64 бита) | Числовой лимит | 128 до 127 | 0 до 255 | 0 до 65535 | -32768 до 32767 | -2147483648 до 2147483647 | -9223372036854775808 до 9223372036854775807 | Безлимитный* | Безлимитный* |
Строки, вероятно, самый простой тип данных для понимания, потому что они очень просты в использовании.
Тип | String | String | Fixed Length String | Fixed Length String | Суффикс | .s | $ | .s | $ | Использование памяти (RAM) | 4 байта (32 бита) | 4 байта (32 бита) | 4 байта (32 бита) | 4 байта (32 бита) | Лимит символов | Безлимитный | Безлимитный | Определяемый пользователем * | Определяемый пользователем * |
Строки могут быть сделаны из любого символа в наборе символов ASCII, включая управляющие символы, за исключением нулевого символа и того, который используется для обозначения конца строки.
Читайте также:
Пожалуйста, не занимайтесь самолечением!При симпотмах заболевания - обратитесь к врачу.
|